I am trying to integearte a functionality in the snitz forums where a page will be displayed, interrupting users. the page will display ads, or some other information. lets not go into ethhics regarding this. this is would definetly prove very useful. the page will have a link saying, 'continue to the message'. Much like the yahoo mail.
i have included this code in inc_header.asp:
<%
function IsPrime(ByRef pLngNumber)
Dim lLngSquare
Dim lLngIndex
IsPrime = False
if pLngNumber < 2 Then Exit function
if pLngNumber Mod 2 = 0 Then Exit function
lLngSquare = Sqr(pLngNumber)
For lLngIndex = 3 To lLngSquare Step 2
if pLngNumber Mod lLngIndex = 0 Then Exit function
Next
IsPrime = True
End function
Dim maxNo
maxNo = 700
Randomize
num = Int(Rnd * maxNo)+1
if(IsPrime(num)) then
Response.Redirect("advert.asp")
'Response.End()
end if
%>
what the above code is doing is just, randomly displat a page ( advert.asp ) based on whether a number is a prime or not ( better algorithms can be developed later, and will use cookies too)
now the advert page has this :
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle"><a href="<%=Request.ServerVariables("HTTP_REFERER")%>">Continue to Message</a> </td>
</tr>
</table>
which is simply displaying the message with the HTTP_referrer in ASP.
now the problem is that the link in the advert page does not contain the link that was clicked and that the user was supposed to go to.
according to my logic :
1.user clicks page link to B.asp on page A.asp
2.page B.asp gets processed in the server ( does not get thrown to the browser ?)
3.since B.asp never shows up in the browser, the referrer is officially A.asp.
But i want B.asp.
how should i get the complete URL to B.asp inm advert.asp
lets complete this step then we can go further
instead it has