matrix211v1 Posted April 11, 2007 Share Posted April 11, 2007 Hello All! I have Apache installed as my web server. On a different server with web page content, like CNN for example, they are going to link to a graphic on my server. The graphic is actually a passed parameter to a PHP script on my server. My question is this. If someone goes to the CNN page with their browser, it should call the web page of CNN, which in turn will call the PHP located on my machine. Can I record the EXACT url where it was called from OR is it limited to the Host? Another way to look at this is if you went to a person's MySpace page, who had a graphic (linked using the PHP script) that was on my server. Will I be able to go to that individual's MySpace account and see my graphic there OR is it just going to tell me it came from MySpace. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Zaid Posted April 11, 2007 Share Posted April 11, 2007 It will tell you the full URL e.g. www.cnn.com/newsstory23423.php and you can access the referral URL from the HTTP supervariables from php Quote Link to comment Share on other sites More sharing options...
only one Posted April 11, 2007 Share Posted April 11, 2007 thats one of the basics in gd google it... Quote Link to comment Share on other sites More sharing options...
anthylon Posted April 11, 2007 Share Posted April 11, 2007 Try $_SERVER['HTTP_REFERER'] . But as I remember in PHP manual they don't guarantee this will work always. But I think that is what you need. Quote Link to comment Share on other sites More sharing options...
utexas_pjm Posted April 11, 2007 Share Posted April 11, 2007 PHP grabs the referring URL from the HTTP request header. It is up to the client whether or not they send a referring URL in their request. Therefore you can't count on it always being there, or if it is there, that it is legitimate. Patrick Quote Link to comment Share on other sites More sharing options...
matrix211v1 Posted April 11, 2007 Author Share Posted April 11, 2007 @utexas_pjm Thanks, that is the answer I was looking for. Quote Link to comment Share on other sites More sharing options...
anthylon Posted April 13, 2007 Share Posted April 13, 2007 So if you solved your issue I think it would be nice for all of us if you could use Solved button (according rules of this forum). Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.