Hello
I am trying to use a form to send data using the code below, however it keeps saying "Undefined Variable: submit" and when I process the form "Undefined Variable: PHP_SELF" - I am clearly doing something stupid, please help.....
<?php
if($submit) {
//process form
$db=mysql_connect("localhost", "root");
mysql_select_db("mydb", $db);
$sql="INSERT INTO employee (first,last,address,position) VALUES
('$first', '$last', '$address', '$position')";
$result=mysql_query($sql);
echo "Thank you! Information entered.\n";
}else{
//display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First Name: <input type="Text name="first"><br>
Last Name: <input type="Text" name="last"><br>
Address: <input type="Text" name="address"><br>
Position: <input type="Text" name="position"><br>
<input type=submit name="submit" value="Enter information">
</form>
<?php
}//end if
?>