Foros del Web » Programando para Internet » PHP »

Parse error: parse error, expecting `','' or `';'' in on line 12

Estas en el tema de Parse error: parse error, expecting `','' or `';'' in on line 12 en el foro de PHP en Foros del Web. Hola, me da este error y este es el código, puede ayudarme alguien <?php defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); $iso ...
  #1 (permalink)  
Antiguo 12/08/2009, 01:55
 
Fecha de Ingreso: agosto-2009
Mensajes: 1
Antigüedad: 14 años, 8 meses
Puntos: 0
Parse error: parse error, expecting `','' or `';'' in on line 12

Hola, me da este error y este es el código, puede ayudarme alguien

<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); $iso = split('=', _ISO);
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>

<head>
<?php if ($my->id) initeditor(); ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>"; />
<?php mosShowHead();
echo "<link rel="stylesheet" href="$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css"type="text/css" />";
echo "<link rel="shortcut icon" href="$GLOBALS[mosConfig_live_site]/images/favicon.ico" />";
?>
</head>

<!-- ODVAJANJE ZAREZOM -->
<body id="color">

<div id="centarmain" style="font-size:12px; width:1000px;">
<div id="rel">

<!--header-->
<div id="header">

<div id="logo">

<div id="tags"><h1><a href="/realtor/index.php" title="Joomla Real Estate Template">Joomla Realestate Portfolio Template</a></h1></div>

</div>
<div id="banner" style="width:468px;"><img height="60" width="468" src="/realtor/images/stories/banner468x60.png" alt="" title="" /></div>

</div>
<!-- end header -->
  #2 (permalink)  
Antiguo 12/08/2009, 01:57
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Parse error: parse error, expecting `','' or `';'' in on line 12

Colocando tu codigo en highlight para verlo mejor:

Código php:
Ver original
  1. <?php
  2. defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); $iso = split('=', _ISO);
  3. echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
  4. ?>
  5.  
  6. <head>
  7. <?php if ($my->id) initeditor(); ?>
  8. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>"; />
  9. <?php mosShowHead();
  10. echo "<link rel="stylesheet" href="$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css"type="text/css" />";
  11. echo "<link rel="shortcut icon" href="$GLOBALS[mosConfig_live_site]/images/favicon.ico" />";
  12. ?>
  13. </head>
  14.  
  15. <!-- ODVAJANJE ZAREZOM -->
  16. <body id="color">
  17.  
  18. <div id="centarmain" style="font-size:12px; width:1000px;">
  19. <div id="rel">
  20.  
  21. <!--header-->
  22. <div id="header">
  23.  
  24. <div id="logo">
  25.  
  26. <div id="tags"><h1><a href="/realtor/index.php" title="Joomla Real Estate Template">Joomla Realestate Portfolio Template</a></h1></div>
  27.  
  28. </div>
  29. <div id="banner" style="width:468px;"><img height="60" width="468" src="/realtor/images/stories/banner468x60.png" alt="" title="" /></div>
  30.  
  31. </div>
  32. <!-- end header -->

Edito:

Para colocar comillas dobles dentro de una cadena delimitada por comillas dobles, debes escaparlas:
echo "Cadena con \"comillas dobles\" dentro";

Para colocar una variable de matriz dentro de una cadena debes codificarla asi:
echo "Esta cadena contiene una {$matriz['indice']} y no da errores";
__________________
- León, Guanajuato
- GV-Foto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:50.