Re: how to send to URL on if statement?

From: Date: Fri, 18 Jan 2002 21:30:00 +0000
Subject: Re: how to send to URL on if statement?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-81158@lists.php.net to get a copy of this message
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" <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; }
-- Sliante, Richard S. Crawford mailto:rscrawford@mossroot.com http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: underpope@hotmail.com "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!"

« previous php.general (#81158) next »