【发布时间】:2010-09-30 22:36:51
【问题描述】:
谁能检查我下面的脚本为什么不起作用?
<script src="http://maps.google.com/maps?file=api&v=2.x&key=
<?php
$this->googleMapsApiKey = $this->getValueFromDB("google", "googleMapsApiKey");
if ($_SERVER['HTTP_HOST']=='www.ABC.info') {
$this->googleMapsApiKey = "Googlemap-keys";
} elseif ($_SERVER['HTTP_HOST']=='www.CBA.com') {
$this->googleMapsApiKey = "Googlemap-keys";
}
?>" type="text/javascript"></script>
非常感谢!!
【问题讨论】:
-
echo $this->googleMapsApiKey;在 PHP 脚本的末尾可能吗? HTML 中的键现在为空。
标签: php google-maps-api-2