Probs with code when switching from php3 to php4

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jayymz
Forum Newbie
Posts: 4
Joined: Thu Jun 27, 2002 2:48 pm

Probs with code when switching from php3 to php4

Post by jayymz »

Hi,

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) &#123;    // <----- 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

&#125; else &#123;

  // 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

&#125;

?>

Any help would be appreciated

/james
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Have you read this?
jayymz
Forum Newbie
Posts: 4
Joined: Thu Jun 27, 2002 2:48 pm

Post by jayymz »

omg.....

i suck at searching the internet :) :)
Post Reply