Re: php redirect

From: Date: Fri, 26 Jul 2002 15:21:56 +0000
Subject: Re: php redirect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-109752@lists.php.net to get a copy of this message
> I have a redirect i would like to do using php. It will go something like > this > if (mysql_db_query ($dbname, $query, $link)) { > {redirect would go here} > } else { > {a different location on this redirect here} > > How can i accomplish this? i just do not know php well enough to code the > redirect. Please help. Thanks in advance and for all of the past help. if (mysql_db_query ($dbname, $query, $link)) { header("Location: http://someurl"); } else { header("Location: http://Adifferentlocation"); Look into the header()-function at http://www.php.net/manual/en/function.header.php First rule of header() is: You cannot send any data before you send a header() (if you don't use the Output buffering-functions). -Jome

« previous php.general (#109752) next »