Hi,
 
I have the following script.  When I open it says: 
 
Notice: Undefined variable: submit in c:\inetpub\wwwroot\phpTest9.php on
line 4
Although the input boxes all show fine.  Obviously it does not do the
first part of the code because ($submit) is not equal to true.
 
<html>
<body>
<?php
if ($submit){
  //Process form
  $db = mysql_connect("eugene","root");
  mysql_select_db("mydetailsonline",$db);
  $sql="insert into employees
(first_name,last_name,cell_phone,home_phone) values
('$first_name','$last_name','$address','$position')";
  $result=mysql_query($sql);
  echo "Thank you! information entered.\n";
}else{
  //display form
  ?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
First name:<input type="Text" name="first_name"><br>
Last name:<input type="Text" name="last_name"><br>
CellPhone:<input type="Text" name="Cell_phone"><br>
Home phone:<input type="Text" name="home_phone"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} //end if
?>
</body>
</html>
 
Thanks again
 
Eugene


Reply via email to