Hi,
I'd like to check the referrer using ASP before displaying my page 'detail.asp', this page is only referred from 'referer.htm'. So I used this code to check the referer, if the user didn't access 'detail.asp' from 'referer.htm', he'll be redirected to the Home page.
Code:
ref = request.ServerVariables("HTTP_REFERER")
response.write "***" & ref & " ***** " 'for debugging
if not instr(1, ref, "202.72.14.45")>0 and not instr(1, ref, "centamap.com")>0 then
response.redirect "http://www.xxx.com/home.htm"
response.write "***" & ref & " ***** "
else
'DISPLAY THE DETAILS
end if
It works perfectly if I display both pages in the same window. From the debugging statement I can see the referer page is captured. However, if in referer.htm I do this:
Code:<SCRIPT LANGUAGE=JAVASCRIPT>
var owindow
function openwindow(URL) {
if (!owindow || owindow.closed) {
//window.open("URL","WindowName","Window
// Features")
owindow =
window.open(URL,"WindowNameHere","width=650,height=450,left=130,top=20,
toolbar=1,location=1,directories=0,status=1,menuBar=1,scrollBars=2,resizable
=1")
if (!owindow.opener) {
//Provide parent reference to new window
// for older browsers
owindow.opener = window }
owindow.focus() }
else {
alert('You already have the window open.')
owindow.focus() }
}
</SCRIPT>
<a href=javascript:openwindow('http://www.xxx.com/detail.asp')>To Detail.asp</a>
the referer is lost, and it is not displayed in detail.asp. So, the only difference in the two cases is that one opens a new window while the other doesn't. Is there a way keep the referer information while opening the target page (detail.asp) in a new window?
Thank you very much!
