![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/03/2012, 04:25
|
![Avatar de syntex](http://static.forosdelweb.com/customavatars/avatar27565_1.gif) | | | Fecha de Ingreso: noviembre-2002 Ubicación: Cataluña
Mensajes: 978
Antigüedad: 22 años, 3 meses Puntos: 4 | |
Evitar mensaje de error en leer xml Como evitar el mensaje de error en leer un archivo xml? Warning: file_get_contents(http://xxxxxx/xml_s3/xml_serverxxxxx...output=metaxml) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\ini_articulos.php on line 63
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:\xampp\htdocs\ini_articulos.php:63 Stack trace: #0 C:\xampp\htdocs\ini_articulos.php(63): SimpleXMLElement->__construct('', 0, false) #1 C:\xampp\htdocs\ini_articulos.php(409): imagenes('SD-C08GJ(BL3A', 'MARCA', '43', 'MODELO') #2 {main} thrown in C:\xampp\htdocs\ini_articulos.php on line 63 Código PHP: $ruta_PartNumber = "http://xxxx:[email protected]/xml_s3/xml_serverxx233.cgi?prod_id=".urlencode(trim(strtolower($PartNumber))).";vendor=".urlencode(trim(strtolower($Marca))).";lang=ES;output=metaxml"; # BUSCAR IMG DEL XML DEL PROVEEDOR # ************************************************************************ $file_PartNumber = @fopen($ruta_PartNumber,"r"); if ($file_PartNumber) { fclose($file_PartNumber); if ($sxe = new SimpleXMLElement(file_get_contents ( $ruta_PartNumber ), NULL, false)) {
__________________ ------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------ |