Really quick question, how can I run a line of PHP code when an HTML button is pressed. What I am trying to do is destroy a php session (to log the user out) when the logout button is pressed.
Thanks!
Really quick question, how can I run a line of PHP code when an HTML button is pressed. What I am trying to do is destroy a php session (to log the user out) when the logout button is pressed.
Thanks!
If you want to use the button, then you should send a form to specific URL address where the session will be destroyed. If you want to use a link instead of a button, then you can point a specific URL address where your session code will be destroyed. All depends on your application architecture. But in one word, you need to send HTTP request to a place where the session will be destroyed.