作者:DZ---Shanghai | 来源:互联网 | 2023-05-19 11:58
Imtryingtocreateasimpleloginformandapagewithapagerestriction我试图创建一个简单的登录表单和一个页面限制的页面
Im trying to create a simple login form and a page with a page restriction
我试图创建一个简单的登录表单和一个页面限制的页面
I have created a mysql database and uploaded details of a user.
我创建了一个mysql数据库并上传了用户的详细信息。
I have created a login page: http://www.diydirector.com/loginform.php Which seemed to work fine. I then set it to direct to the restricted page after a successful login.
我创建了一个登录页面:http://www.diydirector.com/loginform.php这似乎工作正常。然后我将其设置为在成功登录后指向受限页面。
I then created a restricted page with access restrictions based on username and password : http://www.diydirector.com/restricted-page.php The page is set to direct back to the login page in the result of non access.
然后,我创建了一个受限制的页面,其中包含基于用户名和密码的访问限制:http://www.diydirector.com/restricted-page.php该页面设置为直接返回非访问结果中的登录页面。
I cant get access to the restricted page after I type in the correct username and password, i have tried many times.
输入正确的用户名和密码后,我无法访问受限制的页面,我已多次尝试过。
I did all this apart from the mysql database using dreamweaver. Am I missing something Here?
除了使用Dreamweaver的mysql数据库,我做了所有这些。我错过了什么吗?
The username for the login form is: jdoe and the password is: doepass
登录表单的用户名是:jdoe,密码是:doepass
Would seriously appreciate any help on this. Many Thanks in advance
非常感谢任何帮助。提前谢谢了
This is the code for the login form
这是登录表单的代码
= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
Login Form 1
">
username:
password:
This is the code for the restricted page
这是受限页面的代码
0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
Restricted Page
This is the code for the mysql connection that dreamweaver puts in a folder called "connections". (I have blurred out the password)
这是Dreamweaver放入名为“connections”的文件夹中的mysql连接的代码。 (我已经模糊了密码)
1 个解决方案