Professional Documents
Culture Documents
Index
S.No. Assignment Date Grade Signature
Code:-
server.php:-
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
Class
<select name="select">
<option>First Year</option>
<option>Second Year</option>
<option>Third Year</option>
<option>Fourth Year</option>
</select>
Hobbies
</body>
</html>
Output:-
Q.2). Create web pages to understand and use to validate user inputs?
Code:-
Validate.php:-
<html>
<head>
<title>Untitled Document</title>
function checkform(form)
if (form.name.value == "")
form.name.focus();
return false;
else
return true;
if (form.fname.value == "")
return false;
else
return true;
if (form.phn.value == "")
form.name.focus();
return false;
else if(ereg("^[0-9]{6}$"))
else
return true;
return false;
return true;
</script>
</head>
<body>
</p>
</p>
</p>
<p>Email
</p>
<p> </p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</body>
</html>
Output:-
Validate.php:-
Q.3). Create web pages to learn how to navigate between web pages and servers?
Code:-
navigate.php:-
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<tr>
<td width="580">
</tr>
<tr>
</tr>
<tr>
<td><div align="center">Marks</div></td>
<tr>
<td><div align="center">Percentage</div></td>
</tr>
<tr>
<td><div align="center">Grade</div></td>
</tr>
<tr>
<td colspan="2"><label>
</tr>
</table>
</form>
</body>
</html>
next.php:-
<?php
$a = $_POST['name'];
$b = $_POST['rollno'];
$c = $_POST['marks'];
$d = $_POST['percent'];
$e = $_POST['grade'];
?>
<html>
<head>
<title>Untitiled</title>
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body> </html>
Output:-
Navigate.php
Next.php
Q.4) Create login form and validate it username/password stored in database through
PHP?
Code:-
Login.php
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<tr>
</tr>
<tr>
<td colspan="2">
<font color="#FF0000">
<?php
$a=$_GET['msg'];
if($a=='notexist')
?>
</font>
</td>
</tr>
<tr>
</div>
</td>
<td width="397">
</tr>
<tr>
<td><div align="right">password</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
Loginnext.php
<?php
include("db.php");
$a=$_POST['email'];
$b=$_POST['password'];
$sql2=mysql_query($sql1);
$no=mysql_num_rows($sql2);
if($no=='0')
header('Location:login.php?msg=notexist');
else
header('Location:welcome.php');
?>
db.php
<?php
$hostname = "localhost";
$username = "root";
$password = "";
$database = "stu";
mysql_connect($hostname,$username,$password);
mysql_select_db($database);
?>
Output:-
Login.php
Welcome.php
Q.5). Create student record and perform following operations: Add record, delete, and
edit, search record, navigation between records?
Code:-
Index.php:-
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
</a>
<a href="delete.php">
</a>
<a href="modify.php">
</a>
</body>
</html>
add.php:-
<tr>
</tr>
<tr>
<td width="283">Name</td>
<td width="566"><label>
</label></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="2"><label>
</label></td>
</tr>
</table>
</form>
addnext.php:-
<?php
include ("db.php");
$a = $_POST['name'];
$b = $_POST['rollno'];
$c = $_POST['fname'];
$d = $_POST['mname'];
$e = $_POST['dob'];
$f = "INSERT INTO CLASS VALUES('$a','$b','$c','$d','$e')";
mysql_query($f);
header("location:add.php");
?>
delete.php:-
<tr>
</tr>
<tr>
<td width="608">
</tr>
<tr>
<td colspan="2"><label>
</label></td>
</tr>
</table>
</form>
deletenext.php:-
<?php
include ("db.php");
$a = $_POST['rollno'];
mysql_query($b);
?>
modify.php:-
<tr>
</tr>
<tr>
<td width="608"><label>
</tr>
<tr>
<td colspan="2"><label>
</tr>
</table>
</form>
modifynext.php:-
<?php
include ("db.php");
$a = $_POST['rollno'];
$c = mysql_query($b);
?>
<body>
<tr>
<td width="215">Name</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
Output:-
Index.php
Add.php
Delete.php
Modify.php
Q.6). A web application display product names and price in tabular formats. Each
row containing product detail should display Know More button. When the button is
clicked the description for the selected item should be displayed?
Code:-
index.php:-
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<tr>
<h3>S.No.</h3></td>
</tr>
<tr>
<td>1</td>
<td>Nokia E7 Mobile Phone</td>
<td><div align="right">Latest Nokia cell phone with a very light weight and some new
existing features....
</tr>
<tr>
<td>2</td>
<td>Rs.4500</td>
<td><div align="right">Panasonic cordless phone with a very high frequency range and
also phonebook facility....
</tr>
<tr>
<td>3</td>
<td>Rs.1266</td>
<td><div align="right">Nokia 1616, cheapest phone in its range, very good for people who
just want to receive are call people....
</tr>
<tr>
<td>4</td>
<td>Rs.31499</td>
<td><div align="right">Sony ericson Express,a latest Sony mobile handset which gives you
a very good gaming experience and also have 3G facility....
</tr>
<tr>
<td>5</td>
<td>Rs.4675</td>
<td><div align="right">Latest Sony camera which gives you a very high quality image with
its camera of 10.1 megapixels....
</tr>
<tr>
<td>6</td>
<td>Rs.1299</td>
<td><div align="right">Mosar Bear MP3 player gives you facility to play both mp3and
wma digital music files....
</tr>
<tr>
<td>7</td>
<td>Rs.6375</td>
<td><div align="right">Nikon Coolpix Camera can store image in five different formats....
</tr>
</table>
</body>
</html>
Output:-
Index.php