RE: [PHP] how to send to URL on if statement?

From: Date: Fri, 18 Jan 2002 21:25:36 +0000
Subject: RE: [PHP] how to send to URL on if statement?
Groups: php.general 
Request: Send a blank email to php-general+get-81157@lists.php.net to get a copy of this message
Good day, I've had to do something similar to this. I do not think there is a way to do this with only HTML- you either need to use a header like the one shown, or a META tag, and they have to be written right away. I worked around this once with Javascript. The page had an ONLOAD function that would look on the page for a URL (stored as a hidden input element) and then try to go there if the input element had any data in it. This works nicely since you don't actually have to write this data with PHP until you're ready to close your <BODY> tag. Then, when the page is loaded, the ONLOAD triggers and does its work. I don't have the code on me, but this should be a good enough push in the right direction. Hope this helps, ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -----Original Message----- From: Andrea Caldwell [mailto:acaldwell@limitlessweb.com] Sent: Friday, January 18, 2002 2:19 PM To: php-general@lists.php.net Subject: Re: [PHP] how to send to URL on if statement? Sorry, I'm new at this... I have already sent output... any way to do this? Thanks again, Andrea "Ing. Daniel Manrique" <roadmr@entropia.com.mx> wrote in message news:Pine.LNX.4.33.0201181512400.20020-100000@utopia.entropia.com.mx... > > Can anyone advise or direct me to the documentation that references how to > > send a user to a URL if an 'if' statement is satisfied? > > Assuming you hadn't sent any output before: > > if ($condition){ > header("Location: http://wherever.com"); > exit; > } > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#81157) next »