|
查看: 1621|回复: 7
|
急!php‘s session 问题!
[复制链接]
|
|
|
为什么我加了session 变这样?
 |
|
|
|
|
|
|
|
|
|
|
发表于 8-7-2011 04:54 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 8-7-2011 05:04 PM
|
显示全部楼层
<?php
session_start();
if($_SESSION['permission']=="0")
{
print"<script language="Javascript">document.location.href='login.htm' ;</script>";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>E-Leave Application System</title>
</head>
<frameset rows="180,*" cols="*" frameborder="NO" border="0" framespacing="0" >
<frame src="top.htm" name="topFrame" scrolling="NO" >
<frameset rows="*" cols="200,*" framespacing="0" frameborder="NO" border="0">
<frame src="left.htm" name="leftFrame" scrolling="NO" noresize>
<frame src="blank.htm" name="mainFrame">
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
这是我的index.htm |
|
|
|
|
|
|
|
|
|
|
发表于 8-7-2011 10:30 PM
|
显示全部楼层
if($_SESSION['permission']=="0" )
{
print"<script language="Javascript">document.location.href='login.htm' ;</script>";
exit;
}
你这段有问题,去google看看如果在php里面加javascript吧。 |
|
|
|
|
|
|
|
|
|
|
发表于 9-7-2011 12:52 PM
|
显示全部楼层
print"<script language='Javascript'>document.location.href='login.htm'</script>";
这是我的index.htm <<<<-------- ------->>>> index.php |
|
|
|
|
|
|
|
|
|
|
发表于 10-7-2011 04:03 PM
|
显示全部楼层
回复 3# King86
改成<?php
session_start();
if($_SESSION['permission']=="0")
{
print"<script language='JavaScript'>document.location.href='login.htm' ;</script>";
exit;
}
?>
或者
<?php
session_start();
if($_SESSION['permission']=="0")
{
print"<script language=\"JavaScript\">document.location.href=\"login.htm\" ;</script>";
exit;
}
?> |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 11-7-2011 08:59 AM
|
显示全部楼层
if($_SESSION['permission']=="0")
{
echo "<script langauge=javascript>document.location.href='login.htm';</script>";
exit;
}
我放这个就没问题了。。。谢谢大家! |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 11-7-2011 09:09 AM
|
显示全部楼层
没那个问题了,但是我完全拿不到他的staff id...
以下是一部分的coding...
<?php
session_start();
if($_SESSION['permission']=="0")
{
echo "<script langauge=javascript>document.location.href='login.htm';</script>";
exit;
}
$stid=$_SESSION['stid'];
mysql_connect('localhost','root','');
mysql_select_db('record');
$query="select stid,name,title,dept,years,date_join,email,staffid,cbalance,lbalance,entitle,ava from staff,record where staff.stid=record.staff_id and staff.stid='$stid'";
$result=mysql_query($query); |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|