Sorry about that ....


if ($submit) {

        if ($person == "-") {

  $error = "Please select your name!";

  } elseif ($magicword != "password") {

   $error = "Please enter correct password!";

  } else {

                 echo "<b>Hi $person, here are the catalog requests</b>\n";

                 $db = mysql_connect("localhost","login","password");


                 $result = mysql_query("SELECT * FROM catalogs");

                 echo "<br><br><table border=1>\n";

                 echo "

                 while ($myrow = mysql_fetch_row($result)) {




                echo "</table>\n";



if (!$submit || $error) {

 echo "<p><font color=red>$error</font></p>\n";


<form method="POST" action="<?php echo $PHP_SELF ?>">
<table border="0" cellpadding="3" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" id="AutoNumber1">
      <td width="50%">Who is this? </td>
      <td width="50%">
      <p align="right"><select size="1" name="person">
      <option selected value="-">Choose your name</option>
      <option value="Jamie">James Kupernik</option>
      <option value="Tammy">Tammy Kupernik</option>
      <option value="Lisa">Lisa Korte</option>
      <td>Password:</td><td><input type="password" name="magicword"
  <p><input type="Submit" name="submit" value="Get Catalog Requests"></p>

} //endif


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
> On Friday 18 January 2002 00:25, James Kupernik wrote:
> > I found the problem in the form and fixed that, but now anytime I want
> > submit the form by hitting enter, it acts like it's reloading the page.
> > What would be the cause of that? When I click on the submit button the
> > verification and program function correctly, but when I hit enter, they
> > not.
> Please post some code to save us a lot of conjecturing and hypothesising.
> You cannot rely the behaviour of hitting enter to submit a form. In IE &
> pressing enter to submit a form results in the value for the submit button
> NOT being sent. So clicking on the submit button to submit a form is not
> same as pressing enter to submit the form. Thus if you were relying on the
> value of the submit button your code wouldn't work.
> AFAIK Opera does the 'right' thing and sends everything when you press
> to submit the form.
> --
> Jason Wong -> Gremlins Associates ->
> /*
> Sometime when you least expect it, Love will tap you on the shoulder...
> and ask you to move out of the way because it still isn't your turn.
> -- N.V. Plyter
> */

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to