PHP Re-direction Quickie

Associate
Joined
3 Oct 2006
Posts
2,304
Location
London
Hi,

When my php script gets to a certain point in a script, I want it to redirect to another page, but with a certain variable in the url.

eg

http://www.script.com/script.php?mode=1

PHP:
if ($mode == "1"){

//Mode 1
//do some stuff then....
//redirect to same page but with a different mode variable.
//http://www.script.com/script.php?mode=2

} else if ($mode == "2") {

//doe some stuff.....
//end script

} else {

//mode not set, do nothing!

}

Would I use the header function for this or is there something else I should use?
 
Back
Top Bottom