佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1623|回复: 7

急!php‘s session 问题!

[复制链接]
发表于 8-7-2011 04:03 PM | 显示全部楼层 |阅读模式
为什么我加了session 变这样?
回复

使用道具 举报


ADVERTISEMENT

发表于 8-7-2011 04:54 PM | 显示全部楼层
或许你可以把你的coding放上来,让大家看看
回复

使用道具 举报

 楼主| 发表于 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;
       }
        
?>
回复

使用道具 举报

Follow Us
 楼主| 发表于 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);
回复

使用道具 举报


ADVERTISEMENT

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT


本周最热论坛帖子本周最热论坛帖子

ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 14-11-2025 01:18 AM , Processed in 0.140348 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表