No output to the screen, just takes me back to the form page.
Still nothing entered into database and no error reported. I will post the code again with the changes. Also the name of my db is php and table is phptest. Maybe it is this line?:
<form method="post" action="<?php echo $PHP_SELF?>">
I do not have a varialbe set for $PHP_SELF,
Below is code.
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "testphp", "test") or die("couldnt connect");
mysql_select_db("php",$db);
$sql = "INSERT INTO phptest (id,name,address,phone) VALUES ($id,'$name','$address','$phone')"
;
$result = mysql_query($sql);
echo $sql;
if(mysql_error()){
echo mysql_error();
}
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
id:<input type="Text" name="id"><br>
name:<input type="Text" name="name"><br>
address:<input type="Text" name="address"><br>
phone:<input type="Text" name="phone"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>