Member Avatar
mansimran88

The message is not showing. Please help me. Thanks

<?php
/* logout.php */

require('obj.php');


session_destroy();
	

	$_SESSION['msg']='You have successfully logged out. Thank you for the visit.';
			
		header('Location: '.$kPathUrl->adminUrl.'/login.php');
			exit;
			

?>

The message is not showing. Please help me. Thanks

Your session already destroyed, then the $_SESSION will not work. try to use javascript to alert message and redirect it to another page, cause you will not echo anything before header();

Do this >>

<?php
session_start();

require('obj.php');

session_destroy();
	

echo '
<script type="text/javascript">
alert("You have successfully logged out. Thank you for the visit.");
window.location = "your_url_here";
</script>    
';

exit();			

?>

hope this help you >>

Member Avatar
mansimran88

Finally, its working...thank you so much..:)

Finally, its working...thank you so much..:)

Please mark it solved, if you solved your question,,,