Troubles with a PHP session variable after form submission

前端 未结 3 674
Happy的楠姐
Happy的楠姐 2021-01-22 12:36

I\'m setting a PHP session variable with a success message for a HTML form that I\'m submitting. If there are no form errors, I redirect to the same page (using header()) and di

3条回答
  •  春和景丽
    2021-01-22 13:20

    Before displaying the message you could do a check that the message is not empty. If it isn't empty then display the message and immediately afterwards explicitly empty the session variable so that next time the preceding check won't display the message.

    I hope I understood your question :)

提交回复
热议问题