here is my code, i think i may be using post wrong, anyway see my flaw? i get a parsing error on line 17
<html><body>
<?php
$PHP_SELF='simple_form.php';
if (isset($_POST['submit']))
{
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$sql = "INSERT INTO employees (first,last,address,position)
VALUES ($_POST['first'],$_POST['last'],$_POST['address'],$_POST['position'])";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
}
//
//if (isset($_POST['submit']))
//{
// while(list($name, $value) = each($_POST))
// {
//
// echo "$name = $value<br>\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
}
?>
</body>
</html>