From: "Jonathan Villa" <[EMAIL PROTECTED]>

> I want to be able to submit the page to another page vs PHP_SELF.  On
> that page I want to be able to validate the form, and if it fails,
> return the user to the previous page.  Now that's easy, but the catch is
> that I want to retain/repopulate their field values.
>
> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.

Easiest way is to set an error and throw everything into the session.

if(error)
{
  $_SESSION['is_error'] = TRUE;
  $_SESSION['post'] = $_POST;
}

Then on your form page, check for $_SESSION['is_error'], and if it's true...

$_POST = $_SESSION['post'];

and use $_POST to repopulate your form (or just pull the values directly
from $_SESSION).

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to