<html><head>Registration</head><title>Registration Page</title><body><?phpini_set("display_errors", "1");//declaring registration fields$tfname=$_POST['TeacherFName'];$tlname=$_POST['TeacherLName'];$subject=$_POST['Subject'];//connecting to the database$db=mysql_connect("server","id","pw");mysql_select_db("dbname",$db);//Verifying there are no duplicate names in the DB$result=mysql_query("SELECT * FROM teachers_info WHERE fname='". mysql_real_escape_string($tfname)."'",$db); $num=mysql_num_rows($result) or die(mysql_error());echo $num;if ($num!=0){echo"<p> Sorry, this first name already exist in the database</p>";}else// Inputing registration info into the DB, in teachers_info table{$sql="INSERT INTO $teachers VALUES('$tfname','$tlname','','','$subject')";$result=mysql_query($sql,$db);echo "Thank you $tfname";}?></body></html>If you want to check out HTML code of the actaul page with forms.. here