在确保我的工作我的站点的管理员区的尝试由包含限制直接的页面访问
if (isset($_POST['password']) && isset($_POST['userName'])) {
if($_POST['password']==$pass && $_POST['userName']==$username)
{
header('Location: admin.php') ;
}
这重定向到一个文件在同一文件夹名为admin.php的一个的index.php 。问题是我可以访问这个文件,如果我写localhost/folder/admin.php
。请告诉我如何限制直接访问此页面。访问它的唯一方法应该是在用户名和密码后从index.php中获取。