View Full Version : location-esque function?
Is there a function in php that works like the document.location object in javascript? And if not, is there a way to merge php with javascript? I want to write a function that returns a different value for a variable depending on the document.location, but I have no idea how to do this. Thanks.
$loc = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
Thanks, I actually wouldn't have thought to do that . . . but I'm looking for something that will find the location of any frame in the window, including the topmost, not just the one in which the php script resides. I want to compare the url of the "current" frame against the url of the "top" frame.
Then no, I'm afraid not. You'll have to use Javascript to get the values, then possibly pass them to PHP via an XMLHttpRequest.
Read http://www.w3schools.com/ajax/default.asp for a basic introduction.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.