Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/12/2011, 16:33
EduardoCh
 
Fecha de Ingreso: mayo-2009
Mensajes: 43
Antigüedad: 15 años
Puntos: 2
Problema con variable vacia

A ver tengo el siguiente codigo y no paro de darle vueltas al porque me devuelve la variable $value vacia, podrían revisarlo? Muchas veces te ofuscas en algo y tu mismo te invalidas para obtener la respuesta, gracias.

Código PHP:
<body>

<?php
include ('funciones.php');
if (
verificar_correop()){
include (
'cabecera.php');
$conexion mysql_connect('*''*''*'); // se conecta con el servidor

mysql_select_db('campuslista'$conexion); // selecciona la base de datos
$result mysql_query("SELECT * FROM SITIOS"$conexion) or die(mysql_error());
$num_fields mysql_num_fields($result);
for(
$i=1;$i<$num_fields;$i++){

$tabla mysql_query("SELECT * FROM SITIOS") or die(mysql_error());
while (
$registro mysql_fetch_array($tabla)) {
$alpha=$registro['EVENTO'.$i];
$pieces explode(","$alpha);
if (
$pieces[0] != "")
{
echo 
"<table border='1' width='530' height='210'>
  <tr>
    <td height='257' width='23' rowspan='3'>&nbsp;</td>
    <td height='28' width='131'>&nbsp;</td>
    <td height='28' width='354' colspan='2'>$pieces[0]</td>
  </tr>
  <tr>
    <td height='191' width='131'><a href='$pieces[3]' title='click para ampliar' target='_blank'><img src='$pieces[3]' style='noBigImages() padding:10px; width:100; height:100; background-color: #CB292C;' class='centrarimagen'></a></td>
    <td height='191' width='354' colspan='2'>$pieces[2]</td>
  </tr>
  <tr>
    
<td height='25' width='131'>&nbsp;</td>
    <td height='25' width='112'><form method='POST' action='inicio.php'>
      Apúntame en lista!
<input type='checkbox' style='background-color:#CB292C' name='$pieces[0]' onclick='this.form.submit();' value='$pieces[0]'></form></td>
    <td height='25' width='114'>
    <p align='right'>Entrada: $pieces[1]</td>
  </tr>
</table><br></body>"
;
  if(isset(
$_POST[$pieces[0]]))
  {
  
$value .=$pieces[0].",";
  echo 
$value;
  }
}
}
}


mysql_free_result($tabla); // libera los registros de la tabla

mysql_close($conexion); // cierra la conexion con la base de datos
}
  else {
  
//si el correop no es verificado volvera al formulario de ingreso
  
header('Location:index.php');
}
?>