<?php
include 'weather.php';
$data= new SimpleXMLElement($xmlstr);
echo '<table id="forecast"><tr>';
foreach ($data->weather as $weather) {
$date = (string) $weather->date;
$iconUrl = (string) $weather->weatherIconUrl;
$maxF = (int) $weather->tempMaxF;
$minF = (int) $weather->tempMinF;
$desc = (string) $weather->weatherDesc;
echo '<td><ul id="daily"><li class="desc">'. date('D', strtotime($date)) . '</li>
<li><img src="' . $iconUrl . '" alt="weather icon" height="30" width="30"</li>
<li class="temp">' . $maxF . '°/' . $minF . '°</li>
</ul></td>';
}
echo '</tr></table>';
echo '</body></html>';
?>I know I need to do an xmlhttprequest similar to the code below to somehow send the data to the php script, but I'm not sure how to access the data from the php script. Please help.
request.onreadystatechange = function() {
if request.readyState == 4 && request.status == 200{
return true;
}
}
if (window.XMLHttpRequest)
request=new XMLHttpRequest();
else request=new ActiveXObject("Microsoft.XMLHTTP"); // code for IE 6 or before.
request.onreadystatechange;
request.open("GET","forecast.php",true);
request.send(); // Send "Get" request to specified PHP script.
}
Help














