我有2个文件夹:" get",而其他为" admin" get contain contun contun contun用户访问,admin仅具有admin访问权限。我正在尝试将条件放在verfy.php文件中,该文件是(user =='adminname"),然后转到admin文件夹并打开index.html,否则请留在get get feet folder和打开用户文件中。我不知道我在做什么Wright或错,因为IF-portion中的所有三个评论根本无法正常工作:(。这是我的代码的一部分:
<?php
//skiped seesion portion this portion is doing well work after debug
if($username=="amirlatif")
{
// echo "hello";
//include('C:xampphtdocsnew projectadmin');
ini_set("include_path", "/C:xampphtdocsnew projectadmin" . ":" .ini_get("include_path"));
// dirname('C:xampphtdocsnew projectadminindex.html');
}
else
{
//iss main user profile ka ok!!!
}
?>
<?php
if($username=="amirlatif") {
header("location: ../admin/index.php");
} else {
.....
}
?>
如果要将管理员重定向到管理员页面,只需重定向:
<?php
if($username=="amirlatif") {
header("location: path-to-admin-folder/index.php");
} else {
header("location: path-to-user-folder/index.php");
}
?>