Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/04/2012, 00:49
cbs2012
 
Fecha de Ingreso: abril-2012
Mensajes: 7
Antigüedad: 12 años
Puntos: 1
PHP defectuoso

Hola mi error_log aumenta sin medida con un error que tengo en dos PHP.

Os adjunto el error y a qué líneas corresponde (echo $contenido[$vCuenta]; y if ($contenido[$vCuenta] == ' ') {):)

PHP 1:

Código Apache:
Ver original
  1. [Sun Apr 08 18:59:34 2012] [error] [client xx.x.xxx.xxx] PHP Notice:  Undefined variable: contenido in /var/www/vhosts/xxxxx/httpdocs/psico.php on line 55, referer: http://www.xxxxx.es/muestra_re.php?id=66
  2. [Sun Apr 08 18:59:34 2012] [error] [client xx.x.xxx.xxx] PHP Notice:  Undefined variable: contenido in /var/www/vhosts/xxxxx/httpdocs/psico.php on line 45, referer: http://www.xxxxx.es/muestra_re.php?id=66

Código PHP:
Ver original
  1. <div id="recomendada">
  2.                 <p><b>Lectura recomendada: <?php echo $titulo; ?></b></p>
  3.                 <p>
  4.                 <?php
  5.                     $vContPalabras = 0;
  6.                     $vMaxPalabras = 40;
  7.                     $vCuenta = 0;
  8.                     while ($vContPalabras < $vMaxPalabras) {
  9.                         echo $contenido[$vCuenta];
  10.                         if ($contenido[$vCuenta] == ' ') {
  11.                             $vContPalabras++;
  12.                         }
  13.                         $vCuenta++;
  14.                     }
  15.                     echo '...';
  16.                 ?>

PHP 2:

Código Apache:
Ver original
  1. [Sun Apr 08 18:59:34 2012] [error] [client xx.x.xxx.xxx] PHP Notice:  Undefined variable: contenido in /var/www/vhosts/xxxxxx.es/httpdocs/index.php on line 50, referer: http://www.google.com/m/search?aq=f&oq=&aqi=g6-k0d0t0&fkt=837&fsdt=3268&cqt=&rst=&htf=&his=&maction=&q=web
  2. [Sun Apr 08 18:59:34 2012] [error] [client xx.x.xxx.xxx] PHP Notice:  Undefined variable: contenido in /var/www/vhosts/xxxxxx.es/httpdocs/index.php on line 51, referer: http://www.google.com/m/search?aq=f&oq=&aqi=g6-k0d0t0&fkt=837&fsdt=3268&cqt=&rst=&htf=&his=&maction=&q=web

Código PHP:
Ver original
  1. <td colspan="2"><p id="texto_actualidad">
  2.                 <?php
  3.                     $vContPalabras = 0;
  4.                     $vMaxPalabras = 30;
  5.                     $vCuenta = 0;
  6.                     while ($vContPalabras < $vMaxPalabras) {
  7.                         echo $contenido[$vCuenta];
  8.                         if ($contenido[$vCuenta] == ' ') {
  9.                             $vContPalabras++;
  10.                         }
  11.                         $vCuenta++;
  12.                     }
  13.                     echo '...';
  14.                 ?>

¿Qué puede estar fallando?

¡Gracias!

Última edición por cbs2012; 10/04/2012 a las 01:00