Jump to content

logout confirmation


verN

Recommended Posts

hi,

 

i have the following code that enables a user to be logged out. This works perfectly however i now wish a confirmation dialog to appear asking to user to confirm thier actions but how do I do this in this code:

 

<?php
   session_start();
   session_destroy();
   
   
   $logout = "login.php";		
   header("Location: $logout");

?> 

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/47521-logout-confirmation/
Share on other sites

i have the following confirmation dialog but do not know how to use it for the logout

<script type="text/javascript">
<!--
function confirmation() {
var answer = confirm("Are you sure to want to leave")
if (answer){
	window.location = "http://www.google.com/";
}
}
//-->
</script>

Link to comment
https://forums.phpfreaks.com/topic/47521-logout-confirmation/#findComment-232034
Share on other sites

can someone help me please this is bugging me. mY Log out page works but i am trying to set up a confirmation box which asks the user if they want to logout if yes then they are otherwise no. Looking at my code above can someone see where i am going wrong and put me in the right direction.

 

Thnaks

Link to comment
https://forums.phpfreaks.com/topic/47521-logout-confirmation/#findComment-232485
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.