Prabhat wrote on 29 sep 2005 in microsoft.public.inetserver.asp.general:
<BODY onload='document.getElementById("im").src="/start.asp?ref=" +
document.referrer'>
<img id='im' style='display:none;'>
But I think it is not calling the ASP file as the test.txt does not
get created.
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")
%>
==================
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)