Professional Documents
Culture Documents
2020UCD2103
1. Write a Java script to prompt for user name and display it on screen.
alert(name);
2. Write an html code to show the usage of ordered list, unordered list and definition list.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lists</title>
</head>
<body>
<ol>
<li>
Lychas Braueri
</li>
<li>
Cucurbita pepo
</li>
<li>
Paracilacris periclitatus
</li>
</ol>
<ul>
<li>
SSC Tuatara
</li>
<li>
Bugatti Chiron SS
</li>
<li>
Koenigsegg Agera
</li>
</ul>
<dl>
<dt>Deplatform</dt>
<dd>
</dd>
<dt>Digital Nomad</dt>
<dd>
A person who performs his occupation on the internet entirely while traveling.
</dd>
</dl>
</body>
</html>
3. Write separate html codes to show the usage of inline CSS, internal CSS, external CSS.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>inline CSS</title>
</head>
<body>
</body>
</html>
<!-- CODE FOR INTERNAL CSS -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Internal CSS</title>
<style>
body{
background-color: aquamarine;
h1{
color: chartreuse;
font-weight: bold;
</style>
</head>
<body>
<h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>External CSS</title>
</head>
<body>
</body>
</html>
CSS:
h1{color:red;}
-About us
-Our services
-contact us
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home Page</title>
</head>
<body>
</body>
</html>
5. Write an html registration form with validation, on submission the user should be displayed a
confirmation message
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
<body>
<h1>Register</h1>
<br>
<br>
<br>
</form>
<script>
function good(){
if(fname.value == "")
fname.focus();
return false;
if(lname.value == "")
lname.focus();
return false;
if(address.value == "")
alert("Enter Address");
address.focus();
return false;
}
if(email.value == "")
alert("Enter email");
email.focus();
return false;
</script>
</body>
</html>
6. Write an HTML program to design an entry form of student details and send it to store at database
server like SQL, Oracle or MS Access.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PHP insertion</title>
</head>
<body>
<br>
<br>
<br>
</form>
</body>
</html>
7. Write programs using Java script for Web Page to display browsers information.
<html>
<head>
<title>Browser Information</title>
</head>
<body>
<h1>Browser Information</h1>
<hr>
<p>
</p>
<ul>
</script>
</ul>
<hr>
</body>
</html>
8. To write a program, which takes user id as input and displays the user details by taking the user
information from the XML document?
<html> <head>
<script language="javascript">
function fncDisplayInfo()
var xhttp=null;
var flag=0;
xmlDoc.load("user.xml");
for(var i=0;i<parseInt(noOfUsers);i++)
var uid
=xmlDoc.getElementsByTagName("user")[i].childNodes[0].childNodes[0].nodeValue;
if(uid == userid)
var userName =
xmlDoc.getElementsByTagName("user")[i].childNodes[1].childNodes[0].nodeValue;
var Address
=xmlDoc.getElementsByTagName("user")[i].childNodes[2].childNodes[0].nodeValue;
var phone =
xmlDoc.getElementsByTagName("user")[i].childNodes[3].childNodes[0].nodeValue;
var email=
xmlDoc.getElementsByTagName("user")[i].childNodes[4].childNodes[0].nodeValue;
document.write("<br><b>User ID :      "+uid)
document.write("<br>Phone no :      "+phone);
flag =1;
break;
if(flag==0)
alert("InValid User");
</script>
</head>
<body>
<center>
<h1><b>User Information</h1>
<form name="frm">
</form>
</center>
</body>
</html>
9. Writing program in XML and creates a style sheet in CSS & displays the document in internet
explorer.
<?xml-stylesheet href="classic.css"?>
<ARTICLE>
<HEADLINE>A Fairytale</HEADLINE>
<AUTHOR>John Brown</AUTHOR>
<PARA>
Once upon a time, in a kingdom called Pansia lived a brave King. He loved to
play
<INSTRUMENT>flute</INSTRUMENT>
One fine day he called his ministers to hear him play the instrument.
</PARA>
</ARTICLE>
10. Write a program using PHP and HTML to create a form and display the details entered by the user.
<html>
<head>
</head>
<body>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = test_input($_POST["name"]);
$email = test_input($_POST["email"]);
$website = test_input($_POST["website"]);
$comment = test_input($_POST["comment"]);
$gender = test_input($_POST["gender"]);
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<table>
<tr>
<td>Name:</td>
</tr>
<tr>
<td>E-mail:</td>
</tr>
<tr>
<td>Specific Time:</td>
</tr>
<tr>
<td>Class details:</td>
cols="40"></textarea></td>
</tr>
<tr>
<td>Gender:</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</form>
<?php
echo $name;
echo "<br>";
echo $email;
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
?>
</body>
</html>