Simple Forn For Student In PHP
<html>
<head>
</head>
<body>
<form action="" method="POST">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname" /></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname" /></td></tr>
<tr><td>Email:</td><td><input type="text" name="email" /></td></tr>
<tr><td>Gender:</td><td>Male<input type="radio" name="gen" value="Male" />Female<input type="radio" name="gen" value="Female" /></td></tr>
<tr><td>Country:</td><td><select name="con">
<option>Pakistan</option>
<option>London</option>
<option>Paris</option>
</select></td>
</tr>
<tr><td>Hobbies:</td><td>Long Drive<input type="checkbox" name="h[]" value="driving" />Cricket<input type="checkbox" value="Cricket" name="h[]" />xBox<input type="checkbox" value="Xbox" name="h[]" /></td></tr>
</table>
<input type="submit" />
<input name="reset" type="reset" />
</form>
<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$gen = $_POST['gen'];
$con = $_POST['con'];
$val = $_POST['h'];
$c = count($val);
echo '<table border="1" style="font-size:25px; font-family:tahoma; color:green;">';
echo '<tr align="center"><td colspan="2">YOUR INFORMATION</td><tr>';
echo '<tr><td>Your Name:</td><td>'.$fname.'</td></tr>';
echo '<tr><td>Your Last Name:</td><td>'.$lname.'</td></tr>';
echo '<tr><td>Your Email:</td><td>'.$email.'</td></tr>';
echo '<tr><td>Your Gender:</td><td>'.$gen.'</td></tr>';
echo '<tr><td>Your Country:</td><td>'.$con.'</td></tr>';
if (empty($val))
{
echo 'No Hobbies';
}
else
{
}
echo '</table>';
?>
</body>
</html>
<head>
</head>
<body>
<form action="" method="POST">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname" /></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname" /></td></tr>
<tr><td>Email:</td><td><input type="text" name="email" /></td></tr>
<tr><td>Gender:</td><td>Male<input type="radio" name="gen" value="Male" />Female<input type="radio" name="gen" value="Female" /></td></tr>
<tr><td>Country:</td><td><select name="con">
<option>Pakistan</option>
<option>London</option>
<option>Paris</option>
</select></td>
</tr>
<tr><td>Hobbies:</td><td>Long Drive<input type="checkbox" name="h[]" value="driving" />Cricket<input type="checkbox" value="Cricket" name="h[]" />xBox<input type="checkbox" value="Xbox" name="h[]" /></td></tr>
</table>
<input type="submit" />
<input name="reset" type="reset" />
</form>
<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$gen = $_POST['gen'];
$con = $_POST['con'];
$val = $_POST['h'];
$c = count($val);
echo '<table border="1" style="font-size:25px; font-family:tahoma; color:green;">';
echo '<tr align="center"><td colspan="2">YOUR INFORMATION</td><tr>';
echo '<tr><td>Your Name:</td><td>'.$fname.'</td></tr>';
echo '<tr><td>Your Last Name:</td><td>'.$lname.'</td></tr>';
echo '<tr><td>Your Email:</td><td>'.$email.'</td></tr>';
echo '<tr><td>Your Gender:</td><td>'.$gen.'</td></tr>';
echo '<tr><td>Your Country:</td><td>'.$con.'</td></tr>';
if (empty($val))
{
echo 'No Hobbies';
}
else
{
}
echo '</table>';
?>
</body>
</html>