Skip To Main Content | Home | Sitemap | Contact
Latest Visitors: United States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagHong Kong's flagTurkey's flagIndia's flagUnited States's flagGermany's flagSweden's flagMalaysia's flagMalaysia's flagUnited States's flagIsrael's flagUnited States's flagChina's flagChina's flagSweden's flagIndia's flagAustralia's flagIndonesia's flagNorway's flagVietnam's flagTurkey's flag
 

How can you check for registration without back button problems?

The problem was that when a page checked to see if a person had registered prior to viewing protected content, the person would be sent to the registration page. If the person failed to register their browser's history would include the protected page and the registration page. What was needed was a way to redirect the user to the registration page and control their browser's history so as to not repeatedly redirect them to the registration page.  In other words, once the user indicates they do not wish to register, do not allow them to go back to that page.
EXAMPLE: Click link to product page.

Click Here For the Product 1 Page.
Click Here For the Product 2 Page.



<%
'*************************************************
'* AT THE BEGINING OF EVERY PRODUCT PAGE
'*************************************************
Dim fromPage
fromPage = request.servervariables("HTTP_REFERER")

if session("registration")="" then
server.transfer("Control-Back-Button-On-User-Registration-UserReg.asp") 
elseif session("registration")=false then
response.redirect fromPage 
end if
%>
<%
'*************************************************
'* REGISTRATION PAGE
'*************************************************
if LCase(request.servervariables("HTTP_METHOD"))="get" then
  productPage = request.servervariables("SCRIPT_NAME")
  callingPage = request.servervariables("HTTP_REFERER")
else
  Response.Write "POST"
  '**********************************************
  '* DATABASE OR COOKIE ROUTINES HERE
  '**********************************************
  productPage = request.form("from")

  '* IF THEY DID NOT REGISTER (YOU COULD REMOVE THIS)
  if request.form("register")="false" then
    session("registration")=false
    response.redirect request.form("call")
  '* IF THEY REGISTERED CORRECTLY
  elseif request.form("register")="true" then
    session("registration")=true
    server.transfer request.form("from")
  end if
end if 
%>
<html>
<body>
<form name="regform" method="post" action="Control-Back-Button-On-User-Registration-UserReg.asp">
<!-- ADD WHATEVER FIELDS YOU NEED HERE, MAINTAIN HIDDEN FIELDS -->
<input type="radio" value="true" checked name="register">Register&nbsp;&nbsp;<input type="radio" name="register" value="false">Don't Register<br>
<input type="hidden" name="from" value="<%=productPage%>"><br>
<input type="hidden" name="call" value="<%=callingPage%>"><br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
  


This Weeks Most Popular Pages Newest Pages