473,804 Members | 3,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP_REFERER hangs

rf=Request.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" & Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.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 1707
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.redire ct, 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.goo gle.com...
rf=Request.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" &
Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.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.publi c.inetserver.as p.general:
rf=Request.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" &
Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.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.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" &_
Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.com" & sv2

''''''''''''''' '
response.write "http://midvalleyfurnit ure.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 midvalleyfurnit ure.com. It
hangs when I add the url/query string. I've tried response.writin g it
to a link and the url works perfectly, just fails on redirect.

What is server.transfer ?

Thanks,
Brett

"Aaron Bertrand [MVP]" <aa***@TRASHasp faq.com> wrote in message news:<ew******* *******@tk2msft ngp13.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.redire ct, 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.goo gle.com...
rf=Request.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" &
Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.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***@TRASHasp faq.com> wrote in message news:<ew******* *******@tk2msft ngp13.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.redire ct, 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.goo gle.com...
rf=Request.Serv erVariables("HT TP_REFERER")

sv2=Request.Ser verVariables("U RL") & "?" &
Request.ServerV ariables("QUERY _STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redir ect "http://midvalleyfurnit ure.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
9562
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 this I received over 100,000 Hits in less then one hour and it caused my host's server farm to crash. While I understand that I could move to a more robust Web Host, I would rather trap any further links from FARK and redirect them to a rejection...
9
30892
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 or perhaps php.ini, but I'm not sure what? Thanks! Jez
9
28688
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", or something like that... Am I missing something, or is there a better way to do this? <?php $ref = $_SERVER; //echo $ref; if ( $ref == 'http://www.mydomain.com/gatepage.php' ) {
2
5642
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. if(!eregi($HTTP_HOST,$HTTP_REFERER)) Error("Write in the normal way");
2
1673
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 Login.asp page it lets them in. When our users login to go to the other site, they login on our site's Login.asp page. When they click submit, our LoginCheck.asp page validates them and does a response.redirect to the other site. In most cases...
4
5296
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. Anyway, we're using the mm_menu javascript menu for our web menus, and under only Internet Explorer it's not passing the http_referer -- which means any site of theirs we link to from the menu doesn't work. This works fine in Firefox, Mozilla, and...
28
4893
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 referrer URL. How Do I get that? I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
8
1861
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 = Request.ServerVariables("HTTP_REFERER") if (sTest = "") ORELSE (sTest.SubString(sTest.LastIndexOf("/")+1) <> "job_posting_new2.aspx") then newPosition = new Position
6
5360
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 also tried removing it entirely in case that was causing problems. I have tried to extract the HTTP_REFERER in my receiving program with $http_ref = $ENV{'HTTP_REFERER'}; That didn't work so I just printed all variables with foreach $key...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.