Notice: Undefined index: HELP
Posted: Sat Jan 14, 2012 5:16 am
Notice: Undefined index: stdname in C:\webdev\xampp\htdocs\enrollment\adding.php on line 89
Notice: Undefined index: stdaddress in C:\webdev\xampp\htdocs\enrollment\adding.php on line 90
Notice: Undefined index: stdcp in C:\webdev\xampp\htdocs\enrollment\adding.php on line 91
Notice: Undefined index: stdemail in C:\webdev\xampp\htdocs\enrollment\adding.php on line 92
Notice: Undefined index: stdgender in C:\webdev\xampp\htdocs\enrollment\adding.php on line 93
Notice: Undefined index: stdstat in C:\webdev\xampp\htdocs\enrollment\adding.php on line 94
Notice: Undefined index: stdcourse in C:\webdev\xampp\htdocs\enrollment\adding.php on line 95
Notice: Undefined index: stdyear in C:\webdev\xampp\htdocs\enrollment\adding.php on line 96
Notice: Undefined index: stdaddress in C:\webdev\xampp\htdocs\enrollment\adding.php on line 90
Notice: Undefined index: stdcp in C:\webdev\xampp\htdocs\enrollment\adding.php on line 91
Notice: Undefined index: stdemail in C:\webdev\xampp\htdocs\enrollment\adding.php on line 92
Notice: Undefined index: stdgender in C:\webdev\xampp\htdocs\enrollment\adding.php on line 93
Notice: Undefined index: stdstat in C:\webdev\xampp\htdocs\enrollment\adding.php on line 94
Notice: Undefined index: stdcourse in C:\webdev\xampp\htdocs\enrollment\adding.php on line 95
Notice: Undefined index: stdyear in C:\webdev\xampp\htdocs\enrollment\adding.php on line 96
Code: Select all
<html>
<head>
<title> Enrollment form </title>
<body>
<h2> Add student </h2>
<form>
<table>
<tr>
<td align=right> Student Name:</td>
<td><input type=text name="stdname"></td>
</tr>
<tr>
<td align=right> Cellphone #:</td>
<td><input type=text name="stdcp"></td>
</tr>
<tr>
<td align=right> Email Adress:</td>
<td><input type=text name="stdemail"></td>
</td>
</tr>
<tr>
<td align=right valign="top"> Address:</td>
<td>
<textarea rows="5" cols="20" name="stdaddress">
</textarea>
</td>
</tr>
<tr>
<td align=right valign=top> Gender:</td>
<td>
<input type=radio name="stdgender" value=Male> Male <br>
<input type=radio name="stdgender" value=Female> Female
</td>
</tr>
<tr>
<td align=right valign=top> Civil Status:</td>
<td>
<input type=radio name="stdstat" value=Single> Single <br>
<input type=radio name="stdstat" value=Married> Married <br>
<input type=radio name="stdstat" value=Widow> Widow <br>
<input type=radio name="stdstat" value=Separated> Separated
</td>
</tr>
<tr>
<td align=right> Course:</td>
<td>
<select name="stdcourse">
<option value=course1> Educ </option>
<option value=course2> IT </option>
<option value=course3> Busi </option>
<option value=course4> Eng </option>
<option value=course5> Mgt </option>
</select>
</td>
</tr>
<tr>
<td align=right> Year:</td>
<td>
<select name="stdyear" row=2>
<option value=1> 1st </option>
<option value=2> 2nd </option>
</select>
</td>
</tr>
<tr>
<td align=right> <input type=Submit value="Save" name="stdsubmit"></td>
<td><input type=reset value="Reset" name="stdreset"></td>
</tr>
</table>
</form>
</body>
</html
<?php
$database="olpc";
$stdname=$_GET["stdname"];
$stdaddress=$_GET["stdaddress"];
$stdcp=$_GET['stdcp'];
$stdemail=$_GET['stdemail'];
$stdgender=$_GET['stdgender'];
$stdstat=$_GET['stdstat'];
$stdcourse=$_GET['stdcourse'];
$stdyear=$_GET['stdyear'];
@mysql_connect("localhost","root", "");
@mysql_select_db($database) or die( "NO DATABASE");
(isset($_GET['stdsubmit'])) ? trim(htmlspecialchars($_GET['stdsubmit'])) : null;
if($stdname == '') die('We dont seem to have a student name!');
$query = "INSERT INTO stdinfo VALUES('','$stdname','$stdaddress','$stdcp','$stdemail','$stdgender','$stdstat','$stdcourse','$stdyear')";
mysql_query($query);
mysql_close();
?>