pulsedriver Posted March 1, 2007 Share Posted March 1, 2007 I have a problem I can't solve and would be very happy if someone could help me: I have a number of HTML pages on server X, that call an external PHP script on server Y. The PHP script needs to know the URL of the HTML page that calls it. Can this be done without using scripting on the HTML pages on server A? (I want this to work for browsers with javascript disabled) Unfortunately I don't know in advance what HTML pages will call the script. Otherwise I could just manually append the URL of the calling HTML page to the URL for calling the external script. I don't think this can be done dynamically without scripting... Thanks Link to comment https://forums.phpfreaks.com/topic/40662-identifying-url-of-calling-page/ Share on other sites More sharing options...
skali Posted March 1, 2007 Share Posted March 1, 2007 $_SERVER['HTTP_REFERER'] Link to comment https://forums.phpfreaks.com/topic/40662-identifying-url-of-calling-page/#findComment-196734 Share on other sites More sharing options...
pulsedriver Posted March 1, 2007 Author Share Posted March 1, 2007 Will not HTTP_REFERER contain the URL of the page that referred the visitor to the HTML page, rather than the URL of the HTML page that calls the external PHP script? Link to comment https://forums.phpfreaks.com/topic/40662-identifying-url-of-calling-page/#findComment-196749 Share on other sites More sharing options...
pulsedriver Posted March 1, 2007 Author Share Posted March 1, 2007 Also, HTTP_REFERER is depending on the browser being willing to provide that variable. Not bulletproof. Link to comment https://forums.phpfreaks.com/topic/40662-identifying-url-of-calling-page/#findComment-197316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.