急session有关问题

WBOY
Release: 2016-06-13 12:38:19
Original
824 people have browsed it

急!session问题
RewriteRule ^index.html&fun=000$ gyjw/check.php重写了url
我的登陆页面

<?php<br />
	session_start();	//使用session存储用户信息<br />
<br />
	if(isset($_POST["username"]))<br />
	{<br />
		$ss_user_id="";<br />
		<br />
		//利用User累的IsValid()方法判断所输入的用户名和口令是否正确<br />
		require_once("user/UserClass.php");<br />
		$user=new User();<br />
		//如果正确,转到系统首页<br />
		if($user->IsValid($_POST["username"],$_POST["password"],$ss_user_id))<br />
		{<br />
			$_SESSION["ss_user_id"]=$ss_user_id;<br />
			echo "<script language='javascript'>";<br />
			echo " location='index.html';";<br />
			echo "</script>";<br />
		}<br />
		//如果不正确,转到登陆页面<br />
		else<br />
		{<br />
			echo "<script language='javascript'>";<br />
			echo " alert('用户名或密码错误');";<br />
      		echo "</script>";<br />
		}<br />
	}<br />
<br />
?><br />
Copy after login
主页的php
<?php<br />
	include 'http://localhost/gyjw/index.html&fun=000';<br />
?><br />
//省略html部分<br />
Copy after login
check.php
<?php  <br />
	if(! isset($_SESSION['ss_user_id']))<br />
	{   <br />
		echo "<script language='javascript'>";<br />
		echo "alert('您的用户无权进行此操作!');";<br />
		echo "top.location='login.html';";<br />
		echo "</script>"; <br />
		exit;  <br />
	}<br />
?>
Copy after login
问题是登陆成功跳转至主页的时候,先跳转至check.php,之直接就显示了'您的用户无权进行此操作!',说明$_SESSION['ss_user_id']不存在了。然后如果修改了主页的php
<?php<br />
	include ("check.php");<br />
?>
Copy after login
就存在这个$_SESSION['ss_user_id']正常显示了主页内容。
麻烦各位大侠帮助解决!

session url php
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template