Re: How can I redirect to another php page
| From: | (DreamRiver) | Date: | Thu, 09 Jan 2003 10:07:01 +0000 |
| Subject: | Re: How can I redirect to another php page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130901@lists.php.net to get a copy of this message | ||
Teo,
You may want something like this:
switch( $Color ) {
case "Yellow":
header("Location: yellow.php");
break;
case "Green":
header("Location: green.php");
break;
default:
echo"No switch value present for Color - contact the webmaster.";
exit;
} // end switch( $Color )
Depending on usage, you may also get away with a simple:
include_once("yellow.php"); // instead of using header()
Regards,
Richard
http://phpyellow.com
______________________
Teo wrote:
Hi All!
I would like to redirect the user to another php page accordingly to his/her chosen options,
example:
if ($Color == "Yellow") {
go to page ....
else if ($Color == "Green")
go to page ....
}
Does anyone knows how to achieve the goal??
Thanks
Teo