Jump to content

urls in switch function


dan_t

Recommended Posts

How do you use a header function in a switch case? .... Or can you?

Like this-if this makes any sense:

switch($id) {
case "prima":
	header("Location: www.prima-tech.com/");
	break;
case "php":
	header("Location: http://www.php.net/");
	break;
case "slashdot":
	header("Location: http://www.slashdot.org/");
	break;
case "linuxchix":
	header("Location: http://www.linuxchix.org/");
	break;
	default:
	header("Location: www.google.com/");
}	

exit;

 

I was using it with a small made up form, but never got it to work.

 

 

Say hey Kev!!!! Congrats!

Link to comment
https://forums.phpfreaks.com/topic/232117-urls-in-switch-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.