I am trying to echo information from a JS page into a SMS to be sent this is what I have currently
$text = urlencode("$slfirstname $sllastname $slcustom1. Has activated a SOS Panic Button");
How can I run the script I have tried the following but gives me error
$text = urlencode("$slfirstname $sllastname $slcustom1. Has activated a SOS Panic Button <script src="geo.js"></script>");
The end result I want to get is to get Longs and Lats from the PHP and JS to display in the $text section
This is the PHP code that echo's the info on the same page
echo 'Latitude: '.$lat.' Longitude: '.$long.'<br />';
This is the JS code
// 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;
}
}