我自己写了一个方法 如下
$_SERVER['HTTP_REFERER']
可以查看上个页面传递过来的参数
header('content-type:text/html;charset=utf-8');
include_once './lib/fun.php';
judgeVx();
if (checkLogin()) {
msg(1, '您已登录', 'index.php');
}
//表单进行了提交处理
$gourl = 'index.php';
if (empty($_POST['username']) && strstr($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
$gourl = str_replace(getProtocol() . $_SERVER['HTTP_HOST'], "", $_SERVER['HTTP_REFERER']);
}
if (!empty($_POST['username']) && !empty($_POST['password'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$res = login($username, $password);
if ($res == "登录成功"