Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/12/2009, 08:27
becquerel
 
Fecha de Ingreso: diciembre-2009
Mensajes: 15
Antigüedad: 14 años, 4 meses
Puntos: 0
Problemas de generación de xml con php, funciona en local pero en remoto no

Hola a todos saludos desde venezuela mi problema es el siguiente:

tengo u script que me genera un archivo xml desde datos de una base de datos a través de php, es decir, se conecta a la base de datos y por medio de un juego de registros y un loop me extrae los datos que necesito para mi xml, el problema surge cuando lo subo al servidor de mi proveedor de hosting dicho archivo y lo ejecuto y me da el siguiente error:
Parse error: syntax error, unexpected T_STRING in /home/sa001033/public_html/galeras.php on line 45

ubico la línea del error en el archivo y es referente a : <?xml version="1.0" encoding="iso-8859-1"?>

en mi servidor local lo pruebo y funciona correctamente, mientras que en el del proveedor no, el script completo es de la siguiente forma, cualquier ayuda bienvenida es:
Código PHP:
Ver original
  1. [PHP]
  2. <?php require_once('Connections/datos.php'); ?>
  3. <?php
  4. if (!function_exists("GetSQLValueString")) {
  5. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  6. {
  7. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.  
  9. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  10.  
  11. switch ($theType) {
  12. case "text":
  13. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14. break;
  15. case "long":
  16. case "int":
  17. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18. break;
  19. case "double":
  20. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  21. break;
  22. case "date":
  23. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24. break;
  25. case "defined":
  26. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27. break;
  28. }
  29. return $theValue;
  30. }
  31. }
  32.  
  33. mysql_select_db($database_datos, $datos);
  34. $query_sumitogaol = "SELECT * FROM galerias WHERE cliente_id = '1'";
  35. $sumitogaol = mysql_query($query_sumitogaol, $loubidatos) or die(mysql_error());
  36. $row_sumitogaol = mysql_fetch_assoc($sumitogaol);
  37. $totalRows_sumitogaol = mysql_num_rows($sumitogaol);
  38. //Enviar las cabeceras
  39. header('content-type: text/xml');
  40. header('Pragma: public');
  41. header('Cache-control: private');
  42. header('Expires: -1');
  43.  
  44.  
  45. ?>
  46. <?xml version="1.0" encoding="iso-8859-1"?>
  47. <galerias>
  48. <?php do { ?>
  49. <productos>
  50. <foto_id><?php echo $row_sumitogaol['foto_id']; ?></foto_id>
  51. <nombre_archivo><?php echo $row_sumitogaol['nombre_archivo']; ?></nombre_archivo>
  52. <ancho><?php echo $row_sumitogaol['descripcion_foto']; ?></ancho>
  53. <alto><?php echo $row_sumitogaol['alto']; ?></alto>
  54. <cliente_id><?php echo $row_sumitogaol['cliente_id']; ?></cliente_id>
  55. </productos>
  56. <?php } while ($row_sumitogaol = mysql_fetch_assoc($sumitogaol)); ?>
  57.  
  58. </galerias>
  59.  
  60. <?php
  61. mysql_free_result($sumitogaol);
  62. ?>[/PHP]