View Full Version : PHP URLs... the string at the end...
Hitman
19-03-2010, 08:50 PM
Hey,
Basically I want to echo the referring site AND the string on the end. For example, http://example.com/?p=1 - whatever I use (HTTP_REFERER) comes back with just http://example.com. REQUEST_URI just brings the current pages ending... so what do I do? It is possibly, maybe it's with javascript though? I know of another site that does it.
Any help will be appreciated.
Protege
20-03-2010, 09:34 AM
echo $_GET[ 'p' ];
Hitman
20-03-2010, 10:24 AM
Hi,
You don't understand. Here's my example:
I am on http://website.com?p=123 and I go to http://website2.com - I want my script on website2 to get the whole of the referring URL.
If I use HTTP_REFERER it will only get http://website.com and NOT the appending string. I've seen another site doing this, in their control panel, how I don't know (and I doubt they'll tell me).
Protege
21-03-2010, 10:02 AM
Use a button & post information, I haven't really looked into that.
Actually, its because you've just gone website.com?p=123, really website.com/?p=123
eg: heres an example
http://awesomeness.me.uk/urlgrabber/page_1.php?a=lulz
Click the link, it will echo the referer and the script on page_2 is just:
<?php echo $_SERVER[ 'HTTP_REFERER' ];
Hitman
22-03-2010, 02:39 PM
Thanks... it seems to send referrer info. with a JS redirect but not with header or a meta refresh.
Protege
22-03-2010, 04:18 PM
Yes, due to some **** between 301/302 redirections dropping referrer information (I believe, might want some more research into that)
Your best bet is to pass the information on e.g.: ?referrer=page.com/blah.html
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.