<?php
$msg = "";
$snum = $_POST['number'];
$lname = $_POST['last'];
$fname = $_POST['first'];
$mname = $_POST['mid'];
$address = $_POST['add'];
$city = $_POSt['ct'];
$cnumber = $_POST['contact'];
$email = $_POST['mail'];
$course = $_POST['crs'];

	if ($_POST['submit'])
		{
			IF (empty($snum))
				{$mgs .= "Please enter student number. <br> ";}
			IF (empty($fname))
				{$mgs .= "Please enter first name. <br> ";}
			IF (empty($lname))
				{$mgs .= "Please enter last name. <br> ";}
			IF (empty($course))
				{$mgs .= "Please enter course. <br> ";}
		}
	if (isset($_POST['submit']))
		{
			IF (empty($msg))
				{echo" No errors found! <br>";}
			ELSE
				{echo $msg;}
		}
?>

<html>
<body>
<div id = stud>
<form action="form2.php" method="post">
<h2> STUDENTS ADD RECORD </h2>
<br />
<table>
<tr>
<div class="input">
	<td><font color="#FF0000" * </font> Student Number </td>
	<td><input type="text" name="number" value="<?php echo $snum ?>" /></td>
</tr>
</div>
<tr>
<div class = input>
	<td> <font color="#FF0000"> * </font>Last Name </td>
	<td> <input type="text" name="last" value="<?php echo $lname ?>"></td>
</div>
</tr>
<tr>
<div class="input">
	<td> <font color="red"> ^ </font>First Name</td>
	<td> <input type="text" name="first" value="<?php echo $fname ?>"></td>
</div>
</tr>
<tr>
<div class="input">
	<td>Middle Name</td>
	<td><input type="text" name="mid" value="<?php echo $mname ?>"></td>
</div>
</tr>
<tr>
<div class="input">
	<td>Address</td>
	<td><input type="text" name="add" value="<?php echo $address ?>"></td>
</div>
</tr>
<tr>
<div class="input">
	<td>City</td>
	<td>
	<select name="ct">
	<option value=" "></option>
	<option value="qc" <?php if($city ==ct) echo "Selected" ?>> Quezon City</option>
	<option value="mc" <?php if($city ==ct) echo "Selected" ?>> Makati City</option>
	<option value="vc" <?php if($city ==ct) echo "Selected" ?>> Valenzuela City</option>
	</select>
	</td>
</div>
</tr>

<tr>
<div class="input">
		<td>Contact Number</td>
		<td><input type="text" name="contact" value="<?php echo $cnumber ?>"></td>
</div>
</tr>
