On Thursday 19 December 2002 04:45 pm, Beauford.2002 wrote:

> I want to be able to exit out of a PHP webpage and 
> return to the calling page if certain conditions are not met.

> It appears using exit() will do this, but I am unclear exactly how to use
> it.

exit won't do what you want.  exit does NOT bring back the previous
page.  you've already left the previous page (the one you want to
go back to) and the web server is now executing the php script.
your script is checking conditions.  exit will not bring you back to
where you were.  instead, the script will die, and whatever you've
printed will be displayed on the browser.

a hack (don't do it) would be to use javascript to simulate pressing 
the Back button.  that has problems, it won't work if javascript is
not enabled, permissions might not allow you to simulate pressing
the Back button, etc.

the real solution would be to remember what the previous
page "looked" like, and redisplay it.  this may involve remembering
the state of the page (static template, contents of the textfields,
textboxes, checkboxes, etc), and then just redisplaying the 
page with the data *in* the input form.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                        Veritas liberabit vos.
                                Profanity is a crutch for the inarticulate.

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

Reply via email to