i found the solution to 'disable BACK button: <script type="text/javascript"> window.history.forward(); function noBack(){ window.history.forward(); } </script> </head> <body onLoad="noBack();" onpageshow="if (event.persisted) noBack();" onUnload=""> the problem is, when i clicked on 'log out' link, it will redirect user to index.html. then, i clicked 'back' button, it will go back to previous page where, member area, some php code make looks ugly.. 'undefined bla bla bla on line bla bla bla', which mean i already unset all data is the solution of disabled the 'back' button is good?
Hi Mr Shabbir.. I'm really new in php.. i've tried this code, but it doesn't work.. Can you please help me? Thanks..:nice:
im sorry, above code is not working, btw above code is to disabled right click of the mouse so, user cannot copy using 'right-click', and view the source code. here is the right code: <!-- disable right click --> <script> var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; </script> <!-- disable right click -->
im sorry, above code is not working, btw above code is to disabled right click of the mouse so, user cannot copy using 'right-click', and view the source code. here is the right code: <!-- disable right click --> <script> var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; </script> <!-- disable right click -->
I am trying to make a login form and i've tried the coding that u gave... But it doesn't work.. Everytime I try to run the program "Parse error: syntax error, unexpected $end in C:\xampp\htdocs\login.php on line 89" always comes out.. i change the document of index into index1 as i also have another document in htdocs folder, but i also change the script in login.php Code: if ($username=="" or $password=="" ) { echo "<h1>Username or password is blank</h1>"; clearsessionscookies(); header("location: login.php?returnurl=$returnurl"); } else { if(confirmuser($username,md5($password))) // As pointed out by asgard2005 { createsessions($username,$password); if ($returnurl<>"") header("location: $returnurl"); else { header("Location: [B]index1.php[/B]"); (this one from index.php into index1.php) } } else { echo "<h1>Invalid Username and/Or password</h1>"; clearsessionscookies(); header("location: login.php?returnurl=$returnurl"); } } break; case "logout": clearsessionscookies(); header("location: index1.php"); (from index.php into index1.php) break; Does it gives any effect? thanks for your explanation..
Sessions and Cookies are really nice interesting topic to cover. Thanks for sharing mate. Actually i was searching the coding that you given, But now its all clear. I found 2-3 but was not applicable
Create sessions based on user's current details like IP and then check if already logged in or session is live.