0

i have 2 folders: "GET" and other is "admin" get contain user access and admin has admin access only. i am trying to place condition in verfy.php file that is if(user=='adminname") then go to admin folder and open up index.html otherwise stay in GET folder and open user file.i dont know whther am i doing wright or wrong because all three comments in if-portion are not working at all:(. here is the portion of my code:

<?php
//skiped seesion portion this portion is doing well work after debug 
if($username=="amirlatif")
    {

    //   echo "hello";
            //include('C:\xampp\htdocs\new project\admin');
            ini_set("include_path", "/C:\xampp\htdocs\new project\admin" . ":" .ini_get("include_path"));
    //  dirname('C:\xampp\htdocs\new project\admin\index.html');
    }

   else
   {
             //iss main user profile ka ok!!!

   }
?>

2 Answers2

0

if you want to redirect the admin to admin's page, just make a redirection :

<?php

if($username=="amirlatif") {
    header("location: path-to-admin-folder/index.php");
} else {
    header("location: path-to-user-folder/index.php");
}

?>
Jérôme
  • 1,060
  • 1
  • 7
  • 18
0
<?php

if($username=="amirlatif") {
    header("location: ../admin/index.php");
} else {
    .....
}

?>
Gert B.
  • 2,282
  • 18
  • 21