I've a ticker's code like this :
[PHP]<?php
// load SimpleXML
$SECURITIES = new SimpleXMLElement('http://www.zet.com/xml/TableDt.xml', null, true);
echo <<<EOF
<marquee bgcolor="#333333" scrollamount="3" onmouseover=stop() onmouseout=start() ><font face='Time News Romance' font color='white' font size=4><table>
EOF;
foreach($SECURITIES as $STOCK) // loop
{
$change=$STOCK->Change;
echo "SYMBOL:{$STOCK->Symbol_code} ";
echo "PRICE:{$STOCK->Price} ";
if($change==0)
{
echo "<img src='vang.gif'>$change</img> ";
}
else
{
if($change>0)
{
echo "<img src='gre (2).gif'>$change</img>
";
}
else
{
if($change<0)
{
echo "<img src='red.gif'>$change</img>
";
}
}
}
}
echo '</table></marquee>';
?>[/PHP]
it's fine if my xml file is not updated.Now my xml file is updated every 30 seconds,so it get error like this:
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://purpleasia.com/clients/xml/b...bleDt.xml:2309: parser error : expected '>' in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <Best2Bid>26</Best2 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://purpleasia.com/clients/xml/b...bleDt.xml:2309: parser error : Opening and ending tag mismatch: Best2Bid line 2309 and Best2 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <Best2Bid>26</Best2 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://purpleasia.com/clients/xml/b...bleDt.xml:2309: parser error : Premature end of data in tag STOCK line 2298 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <Best2Bid>26</Best2 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://purpleasia.com/clients/xml/b...bleDt.xml:2309: parser error : Premature end of data in tag SECURITIES line 1 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <Best2Bid>26</Best2 in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:\wamp\www\VFMwebsite\VFM_test\ticker.php:4 Stack trace: #0 C:\wamp\www\VFMwebsite\VFM_test\ticker.php(4): SimpleXMLElement->__construct('http://purpleas...', 0, true) #1 {main} thrown in C:\wamp\www\VFMwebsite\VFM_test\ticker.php on line 4
it have no problem from the link(link had given only for ex)
i get this xml file from the host and it will be updated from third party any morning from 7am-11am,this time my php page get error like that.(but it's ok when i refresh few times ,if refresh again ,again get error)
if dont have any solution for this can we hide the error page and appear a message :"loading page..." . can we do that?
thanks so much
Pls help me to solve this problem.Thank you so much