cyfer65 Posted October 2, 2009 Share Posted October 2, 2009 I have a PHP page that checks the "$_SERVER['QUERY_STRING']" and if detects "http" in the URL string it forwards to that URL using a JS redirect..so the referrer looks like "http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi""http://stardrifter.org/cgi-bin/ref.cgi" is website that tells you yer referrer..But on some browsers like "IE" this method doesn't keep the referrer and it shows up blank..So i was wondering if there are any other ways to do a JS redirect that will keep or spoof the referrer for all browsers..??This is my PHP-JS redirect code.. <?phpif ($_SERVER['QUERY_STRING'] != ''){If (stristr($_SERVER['QUERY_STRING'], "HTTP")){$URL = $_SERVER['QUERY_STRING'];Print "<html><body onLoad=\"java script: window.location='$URL';\"></body></html>";}}?> Link to comment Share on other sites More sharing options...
jeffman Posted October 2, 2009 Share Posted October 2, 2009 Why not send a location header right from PHP? Link to comment Share on other sites More sharing options...
cyfer65 Posted October 2, 2009 Author Share Posted October 2, 2009 becuz it wont send the referrer if you input a URL like "http://stardrifter.org/cgi-bin/ref.cgi"'>http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi" directly into yer URL bar and hit enter..And this is what im wanting to do.. to be able to paste the url "http://stardrifter.org/cgi-bin/ref.cgi"'>http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi" into my browser, hit enter, be redirected to "http://stardrifter.org/cgi-bin/ref.cgi" and have my referrer as "http://stardrifter.org/cgi-bin/ref.cgi"'>http://my-site.com/?http://stardrifter.org/cgi-bin/ref.cgi"and php wont do that, but my code does but it doesn't work on some browsers..?? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 2, 2009 Share Posted October 2, 2009 Have you tried using a meta refresh? and php wont do thatDoesn't have anything to do with PHP, it's up to the browser to send the referer header. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.