this piece of code worked perfectly before switch to the latest php version, I've looked for tutorials and other things to help me around this - but no luck....
The error I get is that the variable submit is undefined
Code: Select all
<?php
if ($submit) { // <----- the error is here?
$db = mysql_connect("host", "user", "pw");
mysql_select_db("db1",$db);
$sql = "INSERT INTO sel_utb (user,educ,dist,focus) VALUES ('$user','$educ','$dist','$focus')";
$result = mysql_query($sql);
?>
<blockquote>
<p><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"> Submit recieved!</font></p>
</blockquote>
<?php
} else {
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<blockquote>
<p><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">Namn:</font><br>....
lots of html.....
<input type="Submit" name="submit" value="Send">
</p>
</blockquote>
</form>
<?php
}
?>Any help would be appreciated
/james