简体   繁体   中英

unset PHP session if page refresh

I have a registration page that uses PHP validation. The PHP comes in a separate file. I used session to pass the error messages from the php validation handler to the registration page. I used unset(session) for other pages so when the user navigates from other page, the error msgs will be unset. What if the user tries to refresh the page by clicking the link of registration again from the navigation bar? I cannot unset the error messages from the start of registration page because it will unset the session variables before the error messages displays.

your whole approach is wrong.

just make it one PHP page and one html template.

then do whatever you want. that's the way PHP works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM