Simple Enrollment for College Help
Posted: Mon Jan 09, 2012 7:19 am
I made a simple Add and Search for my Enrollment
I named my database Eva with table info containing first, last, age, cp, email and course
This are my codings please help me Improve it i'm just a newbie at PHP and my cousin who is teaching me PHP just left for singapore.
I named my database Eva with table info containing first, last, age, cp, email and course
This are my codings please help me Improve it i'm just a newbie at PHP and my cousin who is teaching me PHP just left for singapore.
Code: Select all
<html>
<head>
<title>Main</title>
</head>
<body>
<form action="reg.php" method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
Cellphone #: <input type="text" name="cp"><br>
Age :<input type="text" name="age"><br>
E-mail: <input type="text" name="email"><br>
Course :<input type="text" name="course"><br>
<input type="Submit">
</form>
<?
$database="Eva";
$first=$_POST['first'];
$last=$_POST['last'];
$age=$_POST['age'];
$cp=$_POST['cp'];
$email=$_POST['email'];
$course=$_POST['course'];
mysql_connect("localhost","root", "");
@mysql_select_db($database) or die( "NO DATABASE");
$query = "INSERT INTO info VALUES('','$first','$last','$cp','$age','$email','$course')";
mysql_query($query);
mysql_close();
?>
</body>
</html>