freeoffers
New Member
i wrote the following code:\[code\]$xmldom = new DOMDocument();$xmldom->load('http://www.robot-domestici.it/joomla/component/virtuemart/robot-domestici/robot-pulizia-casa?page=shop.feed');\[/code\]but the document loaded is empty (this category don't contains any product) and the following error occurs:\[code\]Warning: DOMDocument::load(): Document is empty in http://www.robot-domestici.it/joomla/component/virtuemart/robot-domestici/robot-pulizia-casa?page=shop.feed, line: 1 in C:\Users\Jacopo\Dropbox\Tirocinio\xampp-portable\htdocs\sites\prova\cerca categorie2.php on line 73Warning: DOMDocument::load(): Start tag expected, '<' not found in http://www.robot-domestici.it/joomla/component/virtuemart/robot-domestici/robot-pulizia-casa?page=shop.feed, line: 1 in C:\Users\Jacopo\Dropbox\Tirocinio\xampp-portable\htdocs\sites\prova\cerca categorie2.php on line 73\[/code\]and interrupt the execution. obviously the URL is generated dinamically and even the contents of the feed can change so i can't know wich URL will be empty. i've to do some check, but i can't figure out what i can do....i'v tried to store the feed in a variable but it don't works:\[code\]$str=file_get_contents('http://www.robot-domestici.it/joomla/component/virtuemart/robot-domestici/robot-pulizia-casa?page=shop.feed');if($str==='') return;\[/code\]what can i do?