Finally after long research I decide to go with javescrip and ajax. Here is the code for someone interest into it. Thanks for your support all. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></scr ipt> <script type="text/javascript" > $(window).unload(function() { $.ajax({ url:"test2.php", type:"POST", async:false, // so browser waits till xhr completed success:function() { alert("bye!"); } }); }); </script> <?php echo "welcome\n"; ?>
<<attachment: smime.p7s>>