Code: Select all
function modifyXML($itemid, $itemrating){
$source = 'vids.xml';
$dom = new DomDocument();
$dom->load($source);
$xpath = new DomXPath($dom);
$itemfound = false;
$itemindex = 0;
$index = 0;
$idnumbers = $xpath->query("//video/videoid/text()");
foreach($idnumbers as $i) { //Search and get correct element index
if($i->data == $itemid){
$itemindex = $index;
$itemfound = true;
}
$index++;
}
if($itemfound = true){ //Modify node
$result = $xpath->query("//video/rating/text()");
echo $result->item($itemindex)->data." is the items rating";
$node = $result->item($itemindex);
$node->data = $itemrating; //This line causes the problem
$dom->saveXML();
}
}
However I am getting the following error:
ERROR - The requested URL could not be retrieved
While trying to retrieve the URL: http://www...../rate.php
The following error was encountered:
* Zero Sized Reply
Squid did not receive any data for this request.
If I remove the line:
$node->data = $itemrating;
All works fine, but does not modify the XML. I have the correct permissions set for the XML as I can modify it else where. The url does not change at any time. Why does that line of code cause this error?
Any help on this one would really be appreciated
Cheers
Cam