Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/11/2011, 08:52
chumy_
 
Fecha de Ingreso: noviembre-2011
Mensajes: 121
Antigüedad: 12 años, 5 meses
Puntos: 0
menu expandible no filtra

Hola a todos, necesito una ayudita...

Necesito un menú expandible, el cual indique una cantidad de proyectos, el cual al seleccionarlo me filtre un resultado final...

Este es mi menu expandible

Código PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>

<body>
<br />
<table width="35%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <div align="center">
        <?php
    $con 
mysql_connect("localhost""root""");
    
mysql_select_db("optchile"$con);
     
    echo 
'<form name="proyectos" method="post" action="prueba2.php" target="down">';
     
    
$sql "SELECT * FROM proyectos ORDER BY proy";
    
$res mysql_query($sql);
     
    echo 
'<select name="proyectos" onchange="this.form.submit()" onclick="this.form.submit()">';
     
    while(
$reg mysql_fetch_array($res))
     {
        echo 
'<option>'.$reg["proy"].'</option>';
     }
    
?>
    
    
       </select>

           </form>
      </div></td>
  </tr>
</table>
<br />
</body>
</html>

Y este es el archivo prueba2.php que muestra los proyectos, pero los muestra todos, no hay filtrado por parte del menu...
Código PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<table border="1" cellspacing=1 cellpadding=2 style="font-size: 8pt">
    <tr background="skins/verdeclaro.png">
        <td width="6%" nowrap="nowrap"><div align="center"><strong>N° CERT</strong></div></td>
        <td width="9%"><div align="center"><strong>FECHA</strong></div></td>
        <td width="30%"><div align="center"><strong>ROYECTO</strong></div></td>
        <td width="36%"><div align="center"><strong>DIRECCION</strong></div></td>
        <td width="19%"><div align="center"><strong>ACCION</strong></div></td>
    </tr>
<?php  
  $link 
= @mysql_connect("localhost""root","")
      or die (
"Error al conectar a la base de datos.");
  @
mysql_select_db("optchile"$link)
      or die (
"Error al conectar a la base de datos.");

  
$query "SELECT `cert`.`ncert`, `cert`.`Fecha`, `cert`.`proyecto`, `cert`.`cod_proy`, `cert`.`poblacion`, `cert`.`calle`, `cert`.`n`, `cert`.`tipo_recinto`, `cert`.`n1`\n"
    
"FROM `cert`\n";
    
?>
  <tr>
  <?php
  $result 
mysql_query($query);
  
$numero 0;
  while(
$row mysql_fetch_array($result))
  {
    echo 
"<tr><td width=\"7%\"><div <font face=\"verdana\" >" .$row["ncert"]. "</font></td>";
    echo 
"<td width=\"8%\"><font face=\"verdana\">" .$row["Fecha"]. "</font></td>";
    echo 
"<td width=\"40%\"><font face=\"verdana\">" .$row["proyecto"]. " - " .$row["cod_proy"]. "</font></td>";
    echo 
"<td width=\"45%\"><font face=\"verdana\">" .$row["poblacion"]. " " .$row["calle"]. " " .$row["n"]. " " .$row["tipo_recinto"]. " " .$row["n1"]. "</font></td>";
    
$numero++;
  }
  echo 
"<tr><td colspan=\"15\"><font face=\"verdana\"><b>Número: " $numero 
      
"</b></font></td></tr>";
  
  
mysql_free_result($result);
  
mysql_close($link);
?>
  </tr>


    
    
</table>
</body>
</html>
Que debo modificar en los codigos para que esto funcione?...

GRACIAS!!!!!!!!!!!!!!!!!!!