Re: Question about the exit() command

From: Date: Thu, 19 Dec 2002 22:41:40 +0000
Subject: Re: Question about the exit() command
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128915@lists.php.net to get a copy of this message
What do you mean "return to the calling page"? The exit() command simply ceases processing of PHP and HTML. I believe what you're saying is that if the user clicks on a PHP hyperlink on the first page, then goes to another page. If there is something "wrong" there, you nwant to return to the page from which you hyper-linked. If that is the scenario, the valriable $HTTP_REFERER refers to the calling page. So: if( condition) header("location: $HTTP_REFERER"); ----- Original Message ----- From: "Beauford.2002" <beauford.2002@rogers.com> To: "PHP General" <php-general@lists.php.net> Sent: Thursday, December 19, 2002 3:45 PM Subject: [PHP] Question about the exit() command Hi, Could someone clarify this for me. 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. any info is appreciated. TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#128915) next »