How to use session inside webpages?

后端 未结 3 1296
清歌不尽
清歌不尽 2020-12-11 13:50

I am trouble with session; I know it theoretically but I encountered with it how to use session , transferring username to

3条回答
  •  借酒劲吻你
    2020-12-11 14:01

    After the line

    $result=mysql_query($sql);
    

    add

    if ($data = mysql_fetch_array($result)) {
        $_SESSION['user'] = $data['usermail'];
    }
    

    Now session created.Call this session in jcte/index.php page as:

    
    

    Unset the session in logout.php page as:

    
    

提交回复
热议问题