duan3601 2011-10-20 11:57
浏览 25
已采纳

销毁会话

i want to destroy a session by clicking on a link. if i click on that link the session will be destroyed, otherwise not. I don't know the exact code for this, but i have tried with this one :

<?php
echo $sess_destory = "<a href='department.php'> Back </a>";

if($sess_destory)
{
session_destroy();  
}
?>

In this way, the session is simply destroying before the time i want. That's why the desired data cannot pass through the other page and showing the error below :

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id, semester, sem_id) VALUES ('','Second Year First Semester','2-1')' at line 1"

  • 写回答

2条回答 默认 最新

  • dsio68964998 2011-10-20 17:49
    关注

    make a generic logout page..

    <?
    session_start();
    session_destroy();
    header("location: index.php");
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗