我正在尝试将来自JS页面的信息回显到要发送的SMS中,这是我目前的
$text = urlencode("$slfirstname $sllastname $slcustom1. Has activated a SOS Panic Button");
如何运行我尝试过以下操作的脚本但是给了我错误
$text = urlencode("$slfirstname $sllastname $slcustom1. Has activated a SOS Panic Button <script src="geo.js"></script>");
我想得到的最终结果是让PHP和JS中的Longs和Lats显示在$ text部分
这是回显同一页面信息的PHP代码
echo 'Latitude: '.$lat.' Longitude: '.$long.'<br />';
这是JS代码
// this calls the php script with the data we have collected from the geolocation lookup
function GEOajax(url) {
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
// this reads the response from the php script and updates the page with it's output
function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById("geo").innerHTML = '' + response;
}
}