0
dean8710's Avatar, Join Date: Aug 2011
Light Poster
Quote:
Originally Posted by patrick View Post
Hello Mr. Shabbir
The code works well, but after logging out, somebody could hit the back button and see any data on the pages. How difficult would it be to prevent anyong seeing the pages after a logout just like the web sites for all the banks?
shabbir - admin:

how to clear all the previous data?
how to restrict the previous page?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by dean8710 View Post
shabbir - admin:

how to clear all the previous data?
how to restrict the previous page?
What previous data you want to clear? Do you want to restrict previous page with back button?
0
dean8710's Avatar, Join Date: Aug 2011
Light Poster
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?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
The best is to session expire the page rather than trying those JS tricks.
0
dean8710's Avatar, Join Date: Aug 2011
Light Poster
tq
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
This tut is really awardworthy
0
shellz's Avatar, Join Date: Sep 2011
Light Poster
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..
0
paulelliott's Avatar, Join Date: Sep 2011
Newbie Member
hi! glad to be here!
0
dean8710's Avatar, Join Date: Aug 2011
Light Poster
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:

[COLOR="DarkGreen"]
<!-- disable right click -->
<script>
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUS EUP);
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 -->
0
dean8710's Avatar, Join Date: Aug 2011
Light Poster
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.MOUS EUP);
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 -->