This is a redirect function that takes care of most redirect functions (session, vars, ect). Uses the header function so you must call this function before any html output.
THere are 4 types of redirect built into this function.
First is a simple redirect called like this redirect("page.php");
Second redirects and adds session info and is i called like this redirect("page.php", 1) the '1' tells the function to add the session info.
third is redirecting while adding variables to the url. called like this redirect("page.php",2,$my array) $my_array contains the variables and values to pass. example
$my_array[0] = "var1=12";
$my_array[1] = "var2=15";
$my_array[2] = "var3=78";
redirect will result in /page.php?var1=12&var2=15$var3=78
THe last redirect is a redirect passing both URL variables as well as session information. redirect("page.php",3,$my_array);