On the top of page, even before html tags are open, I have placed script to check for sessions. Later in the page according to the user submitted options, user is redirected to different pages using header.
This works perfect in wampserver on my system. But on the web server, I get an error that header has already been sent.PHP Code:switch($rsl){
case "A":
header("location: pagea.php");
break;
case "B":
header("location: pageb.php?");
break;
case "C":
header("location: pagec.php?");
break;
default:
header("location: paged.php?");
}
Should I include this code on top of the page, but remember the page direction should occur only after user makes some selections.




Reply With Quote