If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > lock user...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-21-04, 23:42
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
lock user...

how i want to lock user from clicking the back button on the windows...examples like if the click the back button the page will expired
Reply With Quote
  #2 (permalink)  
Old 05-23-04, 19:42
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
this code will expire your page....
Code:
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %> 
<% Response.Expires = -1 %>
Reply With Quote
  #3 (permalink)  
Old 05-23-04, 20:29
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
where to put it????

i'm sorry if my question is a stupid question.but i really dont know where to put the coding that u gave.i want the default back button at the top of the windows...if the user click...the page will expired....please help me...
Reply With Quote
  #4 (permalink)  
Old 05-23-04, 21:05
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Put rokslide's code at the very top of any ASP page you want to expire (in your case, the page you want to expire if the user clicks "Back"). It should be before anything is written to the browser, so ideally, it should be the very first thing in your ASP script.
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #5 (permalink)  
Old 05-24-04, 00:01
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
i've tried

i've tried it but it still cannot work.how?????
Reply With Quote
  #6 (permalink)  
Old 05-24-04, 00:12
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Can you please be more specific when you say it still cannot work.
Reply With Quote
  #7 (permalink)  
Old 05-24-04, 00:32
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
cannot work

below is a part of the whole coding


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/sambung.asp" -->
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
<html>

<%
Dim getid
Dim idaduan

Dim sq
Dim rs
Dim rs1
Dim db
Dim nama
Dim x
Dim y
Dim z
Dim diff2
Dim diff
getid=session("id")
set db=Server.CreateObject("ADODB.Connection")
db.Open"sambung"


i've put the coding u gave at the top.....as a result...when user click the back arrow....the page did not expired....i think i might done a mistake there...please help me
Reply With Quote
  #8 (permalink)  
Old 05-24-04, 10:07
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
You need to put it on the previous page.. the page they would go to if they click the Back button. All you're doing here is expiring the current page.
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #9 (permalink)  
Old 05-24-04, 13:55
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
You can also try:

Code:
<%
Response.AddHeader "Expires", DateAdd("d", -1, Now())
Response.AddHeader "Last-Modified", Now & " GMT"
Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
Response.AddHeader "Pragma", "no-cache"
Response.CacheControl = False
Response.Expires = -1
%>
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #10 (permalink)  
Old 05-24-04, 18:30
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
it needs to go before your include I would guess....

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
<!--#include file="Connections/sambung.asp" -->
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On