Hi there here's my situation;
How do you get rid of an undefined error
message before a for is submited.
This is the error:
"Warning: Undefined variable: submit in c:\path\to\queryalltable.php on line 11"
and this is the code:
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("shantadam","root");
mysql_select_db("quadriscan",$db);
$sql = "INSERT INTO members (firstname,lastname,id,username,password) VALUES ('$firstname','$lastname','','$username','$password')";
$result = mysql_query($sql,$db) or die("Bad query: ".mysql_error());;
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First name:<input type="Text" name="firstname"><br>
Last name:<input type="Text" name="lastname"><br>
User Name:<input type="Text" name="username"><br>
Password:<input type="Text" name="password"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>