I tried changing the line
$sql = "INSERT INTO exer SET name=$first"; as you suggest micah but the only resault I recived from that was that when I would click summit the page would become blank, refreshing it keep it the same but clicking back or entering the address again would bring back the form.
Anyways this is the sample code I was working from if that helps, it was not tested since I didn't feel like setting up a database to use with it.
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$sql = "INSERT INTO employees (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
?>
</body>
</html>