Re: [PHP] how to send to URL on if statement?
There is one other option if you're willing to take a slight drop in performance. Take a quick look at: http://www.php.net/manual/en/ref.outcontrol.php -- Daniel Grace [EMAIL PROTECTED] Richard Crawford [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... If you have already sent output to the browser, then you won't be able to use the PHP header() command to redirect the browser. There are a couple of ways around this, though; look into the META tag in HTML, or you can use JavaScript to redirect the browser. -- 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]
Re: [PHP] how to send to URL on if statement?
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how to send to URL on if statement?
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:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 2:19 PM To: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- 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]
Re: [PHP] how to send to URL on if statement?
If you have already sent output to the browser, then you won't be able to use the PHP header() command to redirect the browser. There are a couple of ways around this, though; look into the META tag in HTML, or you can use JavaScript to redirect the browser. If what you want to do is send all users to the same original page, but then send certain users to another page if the if condition is met, then use PHP to generate the META tag... if (condition) { print(meta-equiv=\Refresh\ content=\15\; URL=\http://my.page.com\;); } I've done that before. It's a pretty useful feature. Andrea Caldwell wrote: Sorry, I'm new at this... I have already sent output... any way to do this? Thanks again, Andrea Ing. Daniel Manrique [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 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; } -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupery Push the button, Max! -- 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]