Forum Moderators: coopster

Message Too Old, No Replies

modify http referer.

         

dulldull

1:38 pm on May 11, 2009 (gmt 0)

10+ Year Member



Hi, i need to automate a form submit process to another site, but the site possibly checks the HTTP_REFERER every time.

By bypassing it, I've used header(location: $url) to refer my users to go directly to that site. But it doesn't work.

As the form in the targeted site is adopting GET method, so i can build up an URL for my users to go. The url is all correct.

Let say, I form an url like this:
http://www.example.com/index.php?string=abcabcabc
When I use header() to redirect my users to go, it doesn't work.
When I type it directly in my browser, it then works.

What's wrong with this? Is header() not enough to change http_referer?

barns101

3:13 pm on May 11, 2009 (gmt 0)

10+ Year Member



As far as I am aware you can't change the referrer because it's sent by the web browser. I needed to do something similar and only managed to send a blank referrer by using the META refresh redirect method.

enigma1

8:31 am on May 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am not sure I understand your question. By default, when you redirect from site A to site B the HTTP referer will be set to site A (assuming you did got an OK response back).

If you mean you want to setup the referer to show site B right after the redirect you can't as you do not control the client end. Your server could setup the request though (site A requests the form) in which case you control the headers but then the server makes the request not the client.