Prabhat wrote on 29 sep 2005 in microsoft.public.inetserver.asp.general:
I have two solutions for you, both tested overhere on a distant ASP-site:
CLIENTSIDE REFERRER SOLUTION:
Try this for your test.html file:
==================
<BODY onload='document.getElementById("im").src="/dummyjpg.asp?ref=" +
document.referrer + "&random=" + Math.random()'>
<img src='' id='im' style='display:none;'>
<a href='show.asp'>show</a>
==================
the Math.random ensures the dummyjpg.asp is fetched every time
src='' is probably necessary.
Try this for your dummyjpg.asp file:
==================
<% Response.Expires = 0 %>
<%
if session("ref") = "" then
session("ref") = Request.QueryString("ref")
end if
%>
==================
And this for your show.asp file:
==================
<% Response.Expires = 0 %>
<%
response.write session("ref")
%>
==================
Mind:
If the test.html is callet from localhost, perhaps there is no referrer
string, so call this file from alother file on a server with:
<a href='
http://www.myTestDomain.org/test1.html'>start the test</a>
=========================================================================
SERVERSIDE REFERRER SOLUTION:
Try this for your test.html file:
==================
<BODY onload='document.getElementById("im").src=
"/dummyjpg.asp?random=" + Math.random()'>
<img src='' id='im' style='display:none;'>
<a href='show.asp'>show</a>
==================
Try this for your dummyjpg.asp file:
==================
<% Response.Expires = 0 %>
<%
if session("ref") = "" then
session("ref") = Request.ServerVariables("HTTP_REFERER")
end if
%>
==================
And this for your show.asp file:
==================
<% Response.Expires = 0 %>
<%
response.write session("ref")
%>
==================