Re: client redirection

From: Date: Wed, 18 Oct 2000 07:24:11 +0000
Subject: Re: client redirection
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20815@lists.php.net to get a copy of this message
On Wed, 18 Oct 2000, Scott Mebberson wrote: > I think that you can use some sort of $HTTP_REDIRECT method maybe(?!?!?) to > redirect the user to a different page. but I understand that this is only > before the header has been sent to the client page. > > What about if you want to redirect the user only if certain conditions > exist. What happens then. I have though of using meta data to do this, but > can meta data be put anywhere in the page? Doesn't it have to be put in the > <head></head> section of the html? > > Is there any PHP redirect method ie > /user_redirect("http://www.whereiwant.com"); > > this would be pretty good. Maybe I am asking for too much. > > thanks > > scott. header("Location: http://www.whereiwant.com") is what you want, in conjunction with some sort of decision structure at the beginning of your script, before you output _anything_ to the client, even white space. There is also some sort of output buffering in later versions of PHP - ob_start and friends. A search on buffer at your local mirror au.php.net:81/ will turn them up. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#20815) next »