Ver Mensaje Individual
  #11 (permalink)  
Antiguo 05/10/2010, 14:50
Avatar de egepe
egepe
 
Fecha de Ingreso: diciembre-2009
Mensajes: 310
Antigüedad: 14 años, 4 meses
Puntos: 7
Respuesta: Busqueda por medio de combobox

Este es tu codigo con los comentarios y a mi me funciona, ahora creo que te falta un boton de "submit" xq claro la primera vez $_POST no tiene nada, pero luego si le das al boton fijate que si muestra el valor.

Eso me hace pensar que tienes un problema en tu lógica
Saludos

Prueba este codigo que es el tuyo como te dije con comentarios y sin manejo de DB
Código PHP:
<?php 
/*
$query = "select count(*) as suma from noticias where mes = '$mes' and anio = '$ano'";
                      $res = mysql_query($query,$conn) or die(mysql_error());
                      $fila = mysql_fetch_array($res);
                      $filas_pagina = 15;
                       $numpaginas = ceil($fila['suma']/$filas_pagina);
 
if(isset($_REQUEST['pagina']))
{
    $pagina=$_REQUEST['pagina'];
}
else
{
    $pagina = 1;
}
                    
  */
?>
<html>
<head>
<title>Noticias</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {
    background-image: url(images/fondoadmin.jpg);
    background-repeat: repeat-x;
}
-->
</style>
<link href="file:///C|/wamp/www/el faroadmin/text.css" rel="stylesheet" type="text/css">
</script>
</head>
<body bgcolor="#EBEBDC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (elfaro_administrador.psd) -->
<table width="1100" height="210" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
        <td height="121" valign="top">
            <img src="images/elfaro_administrador_01.jpg" width="1100" height="121" alt=""></td>
  </tr>
    <tr>
        <td height="26" valign="top">
            <img src="images/botonesmenu/btnsnoticias.jpg" width="1100" height="26" alt=""></td>
  </tr>
    <tr>
        <td width="1100" height="44" valign="top"><table width="1097" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="63" height="7"></td>
            <td width="840"></td>
            <td width="194"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="texttituloseccion">:: <span class="Tituloseccion">Noticias</span></td>
            <td><!--BTN DE AGREGAR --><img src="images/botones/agregarmas.jpg" width="121" height="24"></td>
          </tr>
        </table></td>
  </tr>
    <tr>
        <td height="19" valign="top"><table width="1099" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
            <td></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td> 
            <td class="general">Filtrar por seccion Perteneciente: <form name="form" action="" method="post"><select name="busqueda">
 
 <option value="0">Ver Todas</option>
            <?php
            
echo '<option value="1">Noticias De Campeche</option>';
echo 
'<option value="2">Espectáculos</option>';
echo 
'<option value="3">Deportes</option>';
echo 
'<option value="4">México y El Mundo</option>';
echo 
'<option value="5">Reportajes</option>';
echo 
'<option value="6">Mundo Maya</option>';
echo 
'<option value="7">Lo Insolito</option>';
echo 
'<option value="8">Eventos</option>';
echo 
'<option value="9">Opinión</option>';
            
?>
            </select></select><input name="" type="submit" /></form></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td width="85" height="7"></td>
            <td width="929"></td>
            <td width="85"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><!--AQUI VAS A PONER TU INFO -->
              <table width="928" height="49" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td><table width="929" border="0" cellpadding="0" cellspacing="1">
                    <tr>
                      <td width="19" bgcolor="dcedfd">&nbsp;</td>
                      <td width="597" bgcolor="dcedfd" class="general">Selecione una noticia a editar</td>
                      <td width="313" bgcolor="dcedfd" class="numerodetal"> &nbsp;Numero de Noticias Actuales:<?php             
                     
// echo $fila['suma'];
                      
?></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td><table width="928" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="616" height="23" bgcolor="d8d8d8" class="titucolumnas"><div align="left">&nbsp;&nbsp;Nombre de Noticia</div></td>
                      <td width="143" bgcolor="d8d8d8" class="titucolumnas"><div align="center">Secci&oacute;n</div></td>
                      <td width="96" bgcolor="d8d8d8" class="titucolumnas"><div align="center">Publicada</div></td>
                      <td width="73" bgcolor="d8d8d8" class="titucolumnas"><div align="center">Eliminar</div></td>
                    </tr>
                    <?php
                    
echo "<pre>";print_r($_POST);echo "</pre>";
                    
//if($_POST['busqueda'] == 0){
             //       $sql = "select * from noticias where mes = '$mes' and anio = '$ano' limit ".(($pagina-1)*$filas_pagina).",".$filas_pagina;  //}
                    /*else{
                        $sql = "select * from noticias where mes = '$mes' and anio = '$ano' and seccion = ".$_POST['busqueda']." limit ".(($pagina-1)*$filas_pagina).",".$filas_pagina;}*/
             /*       $result = mysql_query($sql,$conn) or die(mysql_error());
                    while($row = mysql_fetch_array($result)){
                    echo '<tr>';
                    echo '<td><a href="edit_noticias.php?id_noticia='.$row['id_noticia'].'">'.$row['titulo'].'</a></td>';
                    $do = "select * from seccion where id_seccion =".$row['seccion'];
                    $done = mysql_query($do,$conn) or die(mysql_error());
                    $a = mysql_fetch_array($done);
                    if($a['seccion'] == 'noticias de campeche'){
echo '<td align="center">Noticias De Campeche</td>';
}
if($a['seccion'] == 'espectaculos'){
echo '<td align="center">Espectáculos</td>';
}
if($a['seccion'] == 'deportes'){
echo '<td align="center">Deportes</td>';
}
if($a['seccion'] == 'mexico y el mundo'){
echo '<td align="center">México y El Mundo</td>';
}
if($a['seccion'] == 'reportajes'){
echo '<td align="center">Reportajes</td>';
}
if($a['seccion'] == 'mundo maya'){
echo '<td align="center">Mundo Maya</td>';
}
if($a['seccion'] == 'lo insolito'){
echo '<td align="center">Lo Insolito</td>';
}
if($a['seccion'] == 'eventos'){
echo '<td align="center">Eventos</td>';
}
if($a['seccion'] == 'opinion'){
echo '<td align="center">Opinión</td>';
}
echo '<td align="center">'.$row['publicada'].'</td>';
echo '<td align="center"><a href="elim_noticia.php?id_noticia='.$row['id_noticia'].'"><img src="images/botones/eliminar.jpg" /></a></td>';
                    echo '</tr>';
                    } */
                    
?>
                  </table>
                  <?php
/*
echo '<table  cellspacing="3" height="50">';
echo "<tr>";
 
if ($pagina!=1)
{
echo '<td class="nproduct"><strong><a href="noticias.php?pagina=1" style="color:#793f00; text-decoration:none"> << </a></strong></td>';
echo '<td class="nproduct"><strong><a href="noticias.php?pagina='.($pagina-1).' "style="color:#793f00; text-decoration:none"> < </a></strong></td>';
}
 
for($i=1;$i<=$numpaginas;$i++)
{
    $temp='';
    if ($i==$pagina)
        $temp=$i;
    else
        $temp='<a href="noticias.php?pagina='.$i.'" style="color:#000000; text-decoration:none">'.$i.'</a>';
    echo '<td><strong>'.$temp.'</strong></td>'."\n";
}
 
if ($pagina!=$numpaginas)
{
    echo '<td><strong><a href="noticias.php?pagina='.($pagina+1).'" style="color:#000000; text-decoration:none"> > </a></strong></td>';
    echo '<td><strong><a href="noticias.php?pagina='.$numpaginas.'" style="color:#000000; text-decoration:none"> >> </a></strong></td>';
 
}
 
echo "</tr>";
echo "</table>";
 
 
              */    
?></td>
                </tr>
              </table></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
  </tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
Te repito yo lo corrí y funciono perfecto, Ahora como te comente al principio $_POST no existe