Home >Backend Development >PHP Tutorial >php 页面跳转 本土windows 环境正常,上传linux 服务器上跳转不了
php 页面跳转 本地windows 环境正常,上传linux 服务器上跳转不了
php 做的一个下项目,登录后页面跳转到首页,在本地的Windows 环境是正常的,上传到linux服务器上就跳转不了。求解答。
代码,项目结构如下:
action/loginin.php
//user login<br />if (isset($_POST['username']) && isset($_POST['password'])<br /> && !empty($_POST['username']) && !empty($_POST['password'])<br />) {<br /> try{<br /> $username = $_POST['username'];<br /> $password = $_POST['password'];<br /> $rs = $config[DAOIMPL]->getLoginByName($username);<br /> $arr = mysql_fetch_array($rs);<br /> //echo $arr['sys_user_passwd'];<br /> if ($arr && $arr['sys_user_passwd'] == generateUserPassword($password)) {<br /> $_SESSION[SESSIONUSER] = $username;<br /> echo '<script language=javascript>window.location="../index.php"</script>';//跳转到根目录下的index.php<br /> }else {<br /> echo "<script language=javascript>alert('用户名或密码不正确,请重新输入!'); window.location='../login.php'</script>";<br /> exit(0);<br /> }<br /> }<br /> catch (Exception $e){<br /> echo "<script language=javascript>alert('".$e."'); window.location='../login.php'</script>";<br /> exit(0);<br /> }<br />}
if (isset($_POST['username']) && isset($_POST['password']) && !empty($_POST['username']) && !empty($_POST['password'])) {<br /> $username = $_POST['username'];<br /> $password = $_POST['password'];<br /> $rs = $config[DAOIMPL]->getLoginByName($username);<br /> $arr = mysql_fetch_array($rs);<br /> if ($arr && $arr['sys_user_passwd'] == generateUserPassword($password)) {<br /> $_SESSION[SESSIONUSER] = $username;<br /> echo '<script language=javascript>alert("验证成功")</script>';<br /> echo '<script language=javascript>window.location="/cloudsong/index.php"</script>';<br /> }else {<br /> echo "<script language=javascript>alert('用户名或密码不正确,请重新输入!'); window.location='/cloudsong/login.php'</script>";<br /> }<br />}如果登录成功,会弹出“验证成功”对话框,你有吗?