Sorry about that ....

<?php

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");

                 mysql_select_db("countryloft");

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

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

                 echo "
<tr><td><u><b>Name</b></u></td><td><u><b>Address</b></u></td><td><u><b>City<
/b></u></td><td><u><b>State</b></u></td><td><u><b>Zip
Code</b></u></td><td><u><b>Country</b></u></td></tr>\n";

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

                         printf("<tr><td>%s
%s</td><td>%s<br>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n"
,

$myrow[0],$myrow[1],$myrow[2],$myrow[3],$myrow[4],$myrow[6],$myrow[5],$myrow
[7]);

                 }

                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">
    <tr>
      <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>
      </select></td>
    </tr>
    <tr>
      <td>Password:</td><td><input type="password" name="magicword"
size="10"></td>
    </tr>
  </table>
  <p><input type="Submit" name="submit" value="Get Catalog Requests"></p>
</form>
<?php

} //endif

?>


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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
to
> > 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
do
> > 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 &
NN
> 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
the
> 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
enter
> to submit the form.
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> 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 (http://www.php.net/)
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