How to link a HTML link like this – <a href="#">Click here to log out</a>
to a PHP function like – logout()
What I need to do is, when people click a link, php will run the php function.
Please advice! 😀
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can not call a PHP (server-side language) function when clicking on a link. From your question, I suspect you want to provide a link for users to logout, below is how you should go about.
Your link should be like:
And in
logout.phpyou should put php code for logging the user out.Code inside
logout.phpmight look like this: