Hi,

> <form method="POST" action="<?php print("$PHP_SELF"); ?>">
> First Name: <input type=TEXT name="FirstName" size=15><p>
> Last Name: <input type=TEXT name="LastName" size=25><p>
> E-mail Address: <input type=TEXT name="Email" size=25><p>
> <input type=SUBMIT> <input type=RESET>
> </form>

The form should work.

> <?php
> if(!IsSet($FirstName, $LastName, $Email))
>  {
>  header("Location: http://www.SITE.com/error.php");
>  exit;
>  }
> else
>  {
>  header("Location:
> http://www.SITE.com/thanks.php");
>  exit;
>  }
> ?>

This won't work.  I assume that this code is included on the page with the
form above.  First, the header() function must be called before any output
is sent to the browser or it will throw an error and stop.  The second
problem is that the first time a user comes to this page, it will throw then
to the error page because the vars won't be set.  Try this:

<?
    if($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
    {
        (!isset($Email)||!isset($FirstName)||!isset($LastName))?
            header("Location: http://www.SITE.com/error.php"):
            header("Location: http://www.SITE.com/thanks.php");
    }
?>

Then put your form below it.  This will work unless you do a form post to
this page from another page in which case it will throw you to the error
page.

Jason


-- 
PHP General 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