Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable forward button once come to home page

Status
Not open for further replies.

meenakshidhar

Programmer
Oct 19, 2001
77
0
0
MY
Hi friends...
I my application, i used session variables to check the authenticity of the user on every page...user logs in and browse the various pages of his work area...if user returned to the login page without clicking "logout" i.e. by clicking browser's back button, then he should not be able to click Forward button till he enters the valid password again...i mean to say that forward button shld not work once he comes to the login page....
Can anybody plss help me out....


Regards
Meenakshi Dhar
 
my code is given below...

login.html----

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY>
<FORM METHOD=POST ACTION="submit.asp">

<INPUT TYPE="text" NAME="name">
<INPUT TYPE="submit">

</FORM>

</BODY>
</HTML>


submit.asp---

<%
if request.form("name")="admin" then
session("val")=true
response.redirect "right.asp"
else
session("val")=false
response.redirect "login.asp"
end if
%>

right.asp---

<%
if session("val")=false then
response.redirect "login.asp"
else
%>
User is valid...
<%
end if
%>

--------------------------------------------------------------
Now on the login page, i enter 'admin' in the textbox and submits the form...it will validate the name and then call "right.asp"...if user is valid it will show msg "User is valid"....till here it is fine, but now if i click back button it will return to "login.asp" and then if i click forward button it will show me "right.asp" page without entering the anything on the login page...
this is where i m stuck!!!
 
Meenakshi,

Well I have read many articles but as far as I know u cannot do this.Because the browser is running on the client (user) machine and how can we change that.

By the way I dont understand why do u need to do this.

I was very happy to see ur full name.Because I am also a Kashmiri.

Regards
Vikram Shah.
 
To use this "tip", you'll need to do a bit of research regarding the javascript "replace" command...

I've used things like document.location.replace(' to achieve results similar to what you seek.

Basically, you need to submit the form via a javascript function that will cause the "current" document to be "replaced" in the browser's "history". So, going forward or back, is disabled... because the new page takes the place of the previous page... the browser no longer remembers the "first" page.

That's pretty unclear. Sorry 'bout that... but I'm reasonably sure you can achieve the desired result with some permutation of the above... Good luck with your project.

Mr3Putt
Seattle (actually, Portland today)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top