verN Posted April 18, 2007 Share Posted April 18, 2007 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 More sharing options...
clown[NOR] Posted April 18, 2007 Share Posted April 18, 2007 i'm not sure, but I think that has to be done with a javascript inside the php codes... Link to comment https://forums.phpfreaks.com/topic/47521-logout-confirmation/#findComment-231986 Share on other sites More sharing options...
verN Posted April 18, 2007 Author Share Posted April 18, 2007 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 More sharing options...
verN Posted April 18, 2007 Author Share Posted April 18, 2007 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 More sharing options...
per1os Posted April 18, 2007 Share Posted April 18, 2007 You need a javascript prompt http://javascript.internet.com This is a php forum, not javascript bud. Link to comment https://forums.phpfreaks.com/topic/47521-logout-confirmation/#findComment-232496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.