473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

HTTP_REFERER hangs

rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" & Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if


If I put the redirect back in, it hangs and times out. Otherwise, works fine.

What am I doing wrong?

Thanks,
Brett
Jul 19 '05 #1
4 1688
Can't reproduce; need more information.

Have you tried using the same code in a different page? On a different
server? From different referrers? Using a different redirect URL?

Have you tried response.write instead of response.redirect, and paste the
displayed URL in the browser directly?

Have you tried using server.transfer, or sending the URL to client-side
script to perform the redirect? Have you considered using the client-side
window.history.go(-1); method (not sure of the exact syntax, I think that's
close)?

You need to help us narrow down which variables are factors and which are
not...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Brett" <cl***************@yahoo.com> wrote in message
news:99**************************@posting.google.c om...
rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if


If I put the redirect back in, it hangs and times out. Otherwise, works
fine.

What am I doing wrong?

Thanks,
Brett

Jul 19 '05 #2
Brett wrote on 21 mei 2004 in microsoft.public.inetserver.asp.general:
rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if

If I put the redirect back in, it hangs and times out. Otherwise,
works fine.


Try this for debugging, and you will probably see that the redirect is to
an illegal string:

rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &_
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2

''''''''''''''''
response.write "http://midvalleyfurniture.com" & sv2
response.end
''''''''''''''

end if

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
The redirect works fine, if only going to midvalleyfurniture.com. It
hangs when I add the url/query string. I've tried response.writing it
to a link and the url works perfectly, just fails on redirect.

What is server.transfer?

Thanks,
Brett

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message news:<ew**************@tk2msftngp13.phx.gbl>...
Can't reproduce; need more information.

Have you tried using the same code in a different page? On a different
server? From different referrers? Using a different redirect URL?

Have you tried response.write instead of response.redirect, and paste the
displayed URL in the browser directly?

Have you tried using server.transfer, or sending the URL to client-side
script to perform the redirect? Have you considered using the client-side
window.history.go(-1); method (not sure of the exact syntax, I think that's
close)?

You need to help us narrow down which variables are factors and which are
not...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Brett" <cl***************@yahoo.com> wrote in message
news:99**************************@posting.google.c om...
rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if


If I put the redirect back in, it hangs and times out. Otherwise, works
fine.

What am I doing wrong?

Thanks,
Brett

Jul 19 '05 #4
Solved it. It was redirecting to pages with the same code to grab the
referrer. Since it was a redirect, there was no referrer, and it hung,
so I just passed another var to make sure the referrer code didn't run
a second time.
Brett
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message news:<ew**************@tk2msftngp13.phx.gbl>...
Can't reproduce; need more information.

Have you tried using the same code in a different page? On a different
server? From different referrers? Using a different redirect URL?

Have you tried response.write instead of response.redirect, and paste the
displayed URL in the browser directly?

Have you tried using server.transfer, or sending the URL to client-side
script to perform the redirect? Have you considered using the client-side
window.history.go(-1); method (not sure of the exact syntax, I think that's
close)?

You need to help us narrow down which variables are factors and which are
not...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Brett" <cl***************@yahoo.com> wrote in message
news:99**************************@posting.google.c om...
rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if


If I put the redirect back in, it hangs and times out. Otherwise, works
fine.

What am I doing wrong?

Thanks,
Brett

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John A. Irwin | last post by:
I'm very new to PHP and am trying to figure out how to parse out a variable "HTTP_REFERER". My reason for this is my site was recently "FEATURED" (sic) on a website called FARK.COM. Because of...
9
by: Jez | last post by:
Any ideas why I'm not able to use $_SERVER on my shared hosting account (PHP 4.1.2), but I can on my local server (PHP 4.3.3)? I imagine it has something to do with the different versions of PHP...
9
by: deko | last post by:
I have a page that I don't want anyone to be able to link directly to. The page should only be accessed from gatepage.php. I tried this code, but keep getting errors - "header info already sent",...
2
by: ssk | last post by:
Hello! I made a web site using PHP Open sources for message board. Everything's fine except one computer can't open a message writing page. The code that gives an error is the following. ...
2
by: M Smith | last post by:
On our web site we allow our members access to features hosted by another web site. The way the other web site authenticates users is to check the value of the HTTP_REFERER. If it comes from our...
4
by: Ringo Langly | last post by:
Hi everyone, We're using an outside vendor to provide some content for our website, and they use the http_referer variable to verify their content is only viewed from subscribing customers. ...
28
by: Prabhat | last post by:
Hello, I have the below requirement. When ever my website is opened by any link: say clicked from the google search result or a link from other website: Then I should able to know the...
8
by: tshad | last post by:
Why would HTTP_REFERER not be there in the Page_Load event? I am using it to determine whether a page was called from a particular page. I am doing: sTest =...
6
by: Lorna | last post by:
I can't seem to get the ENV variable HTTP_REFERER when posting with CGI from one program to another. In my post program I have put in the <HEAD> HTTP_REFERER =my host - ie www.xyz.com (I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.