Hi everyone, in order to insert a Googlemap into my php script, I have to insert the following <script> </script> from google.
Basically, what happens, is that I sign up for an API key (that long hashed thingy in the above code), and each API key is valid for a single domain.
My question, is how is google able to extract the DOMAIN from which the referring html file is from?
For example, if
Has this line:
<script src="5iaKLIJRNgSvLWExT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrRSx3e-PjL-
lsF9wQWNXG5amDGw" type="text/javascript"></script>
Google will know that is the calling domain.
The only way i know how to grab this is by using JS's location.href, however, assuming a PHP file serves up the JS, i do not know how to obtain the referring domain.
Appreciate any help.. Thanks!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<script src="[URL unfurl="true"]http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAMmQqgY[/URL]
5iaKLIJRNgSvLWExT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrRSx3e-PjL-
lsF9wQWNXG5amDGw" type="text/javascript"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px"></div>
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
//]]>
</script>
</body>
</html>
Basically, what happens, is that I sign up for an API key (that long hashed thingy in the above code), and each API key is valid for a single domain.
My question, is how is google able to extract the DOMAIN from which the referring html file is from?
For example, if
Has this line:
<script src="5iaKLIJRNgSvLWExT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrRSx3e-PjL-
lsF9wQWNXG5amDGw" type="text/javascript"></script>
Google will know that is the calling domain.
The only way i know how to grab this is by using JS's location.href, however, assuming a PHP file serves up the JS, i do not know how to obtain the referring domain.
Appreciate any help.. Thanks!