Forum Moderators: open
Is there any reason this is happening this way? Is there a work around? A way to spoof the HTTP_REFERER in the SERVER vairables?
If you place the javascript redirect above a meta redirect it should still work (with the wrong referrer) if javascript is disabled.
NOTE
Referrer data is entirely under the control of the browser (and can be switched off) different browsers may behave differently. You should probably look for an alternative approach.
Kaled.
1-The user enters my site with a certain referral code (?SRC=X)
2-PHP Code checks this referral code. If it is present, it checks to see if the traffic is coming from a specific referral site.
3-If both of these conditions are true, PHP writes a form to the document that autoposts, sending a random URL from a database back to the header.
4-Another PHP script writes a meta tag that redirects the browser to the database URL.
So: The user comes from X website by clicking on X link. A PHP script checks this. If true, it autosubmits a form that refreshes the page with a TRUE value. A second PHP script checks the TRUE value from the form and then writes a line to redirect the browser.
And this doesn't show my site as being the referer! Maybe having the form autosubmit to another page on my site will change the referer?
Might I suggest that you go back to the beginning and look at the whole problem rather than this small part - you may find a simpler and more efficient solution.
In any case, you should ensure that your website does not fail if referrer data is switched off in the browser.
Kaled.
I agree with Kaled that there are better ways to achieve your goal, but hopefully, this explanation of why you're having trouble will help.
Jim
Just a technical note: A meta-refresh is not an HTTP redirect. It is a client-side reload. Therefore, the Referer header (an HTTP header that may be sent with each request to the server) is not updated to reflect the URL of the page invoking the meta-refresh.
That's the information I was looking for. I will try auto-posting to another page and moving my form to the bottom of the page.
Thanks!