php sessions to authenticate user on login form

前端 未结 7 1745
借酒劲吻你
借酒劲吻你 2020-12-01 07:29

I have the following code designed to begin a session and store username/password data, and if nothing is submitted, or no session data stored, redirect to a fail page.

7条回答
  •  春和景丽
    2020-12-01 07:31

    Here are a few other things, which may or may not help you, by the way :

    • Do you have error_reporting on ? (see also)
    • Do you have display_errors on ?
    • Is session_start the first thing you are doing in your page ? There must be nothing output before
    • Are the cookies created on the client-side ?
    • header Location indicates the browser it has to go to another page ; it doesn't stop the execution of the PHP script. You might want to (almost always anyway) add "exit" after it.

提交回复
热议问题