Hey ppl,
For the login code below, i want to show the user the main page, main.php once he gives the correct combination of username and password, Now how do i go about writing the code to display him main.php? How do you write it? Tq.
<?
if(substr($SERVER_SOFTWARE,0,9)=="Microsoft"&&
!isset($PHP_AUTH_USER)&&
!isset($PHP_AUTH_PW)&&
substr($HTTP_AUTHORIZATION,0,6)=="Basic"
)
{
list($PHP_AUTH_USER,$PHP_AUTH_PW)=
explode(":",base64_decode(substr($HTTP_AUTHORIZATION,6)));
}
if($PHP_AUTH_USER!="user"||$PHP_AUTH_PW!="pass")
{
header('WWW-Authenticate:Basic realm="Realm-Name"');
if(substr($SERVER_SOFTWARE,0,9)=="Microsoft")
header("Status:401 Unauthorized");
else
header("HTTP/1.0 401 Unauthorized");
echo "You are not authorized to view this information.";
}
else
{ //how do i show the user the main page, main.php?
echo"main.php"; //is this the way? i m sure not,what then?
}
?>