weixin_33676492 2016-01-29 08:01 采纳率: 0%
浏览 14

HTML中的会话变量

I have an index.html which contains a login form. When user submits it proceeds to login.php and when the user is verified, It heads back to index.html. The verified username is stored in a session variable called username. So I want that username to be shown at the top of my index.html. Something like 'Hi ' or 'Hi Guest' if session variable is empty. Please help.

UPDATE: I think ajax or jquery can help to retrieve that session variable. Plum ' s idea should work but isn't. So I request to post full fledged files. Thanks.

  • 写回答

3条回答 默认 最新

  • weixin_33705053 2016-01-29 08:07
    关注

    Use

    if(empty($_SESSION['username'])){
        echo 'hi guest';   
    }
    
    评论

报告相同问题?