PHP sessions with HTML

前端 未结 4 1925
温柔的废话
温柔的废话 2020-12-31 22:44

I have a website which uses PHP and HTML pages, I want to create a session which stores a username from the login page. But the login pages are php and the next pages are ht

4条回答
  •  余生分开走
    2020-12-31 22:54

    You are trying to share a PHP session variable with a page that is of type text/html. As you suggested you must make the HTML page a PHP page for this to work and add a little snippet of PHP somewhere to display the user name.

    Change your HTML page to PHP. At the top of the page add something like this:

    
    html here
    Hello !
    

提交回复
热议问题