TY_BCA_AWT_SLIP 10_2



1   10.  Create a form to accept student information (name, class, address). Once the student
information is accepted, accept marks in next form (Java, PHP, ST, IT, pract1, and project).
Display the mark sheet for the student in the next form containing name, class, marks of the
subject, total and percentage(Use $_COOKIE).


Html file :
<html>
<body>

<form action="slip_10-1.php" method="post">
<center>
<h2>Enter Students information :</h2>

<table>
<tr><td>Name : </td><td><input type="text" name="name"></td><tr>
<tr><td>Address : </td><td><input type="text" name="addr"></td></tr>
<tr><td>Class : </td><td><input type="text" name="class"></td></tr>
<tr><td></td><td><input type="submit" value=Next></td></tr>
</table>
</center>

</form>
</body>
</html>
Php file :
Slip_10-1.php :
<html>
<body>

<form action="slip_10-2.php" method="post">
<center>
<h2>Enter Marks for Student:</h2>

<table>
<tr><td>Java : </td><td><input type="text" name="m1"></td><tr>
<tr><td>PHP : </td><td><input type="text" name="m2"></td></tr>
<tr><td>ST : </td><td><input type="text" name="m3"></td></tr>
<tr><td>IT : </td><td><input type="text" name="m4"></td></tr>
<tr><td>Practical : </td><td><input type="text" name="m5"></td></tr>
<tr><td>Project : </td><td><input type="text" name="m6"></td></tr>
<tr><td></td><td><input type="submit" value=Next></td></tr>
</table>
</center>

</form>
</body>
</html>

<?php
setcookie("stud1",$_POST['name'],time()+3600);
setcookie("stud2",$_POST['addr'],time()+3600);
setcookie("stud3",$_POST['class'],time()+3600);
?>

Slip_10-2.php :

<?php
echo "<h3>Marksheet</h3> ";

echo "Name : ".$_COOKIE['stud1']."<br>";
echo "Address : ".$_COOKIE['stud2']."\n";
echo "Class : ".$_COOKIE['stud3']."\n";

echo "Java : ".$_POST['m1']."\n";
echo "PHP : ".$_POST['m2']."\n";
echo "ST : ".$_POST['m3']."\n";
echo "IT : ".$_POST['m3']."\n";
echo "Practical : ".$_POST['m3']."\n";
echo "Project : ".$_POST['m3']."\n";

?>

No comments:

Post a Comment

Note: only a member of this blog may post a comment.