no, no utilizo variables de sesion
funcion de menu
Código PHP:
function menu($categoria, )
{
$categoria= $_POST['categoria'];
?>
<form name="menu" enctype="multipart/form-data" method="post" action="anuncios.php" >
<table width="1152" height="240" border="0"cellpadding="0" cellspacing="0">
<tr>
<td height="240" bgcolor="#3a6ea5"><table width="1085" height="165" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="844"><table width="816" height="165" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="204" bgcolor="#33CCFF"><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="left"><strong> Lo que buscas </strong></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="298" bgcolor="#33CCFF"><table width="238" border="0">
<tr>
<td><div align="center">Categoria </div></td>
</tr>
<tr>
<td><?php crear_select($categoria);?> </td>
</tr>
</table></td>
<td width="246" bgcolor="#33CCFF"><table width="200" border="0">
<tr>
<td>Descripcion</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="68" bgcolor="#33CCFF"> </td>
</tr>
<tr>
<td bgcolor="#66FFFF"><table width="200" border="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="left"> </td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td bgcolor="#66FFFF"> </td>
<td bgcolor="#66FFFF"> </td>
<td bgcolor="#66FFFF"> </td>
</tr>
</table>
</td>
<td width="312"><table width="203" border="0">
<tr>
<td width="188" align="left"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="26" align="center"> <input type=submit value="Buscar" > </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
funcion obtener Libros
Código PHP:
function obtener_libros($categoria)
if (!($conn = db_connect()))
{
echo " No conectado ";
return false;
}
$result = mysql_query( "select * from libros where categoria = '$categoria'");
if (!$result)
{
return false;
}
global $global_result;
$global_result=$result;
return global_result;
};
formato_resultados($global_result);
Código PHP:
function formato_resultados($global_result)
{
while ($row=mysql_fetch_array($global_result))
{ //Bucle para ver todos los registros
$titulo=$row['Titulo']; //datos del campo nombre
$cambiox=$row['autor']; //datos del campo teléfono
$ciudad=$row['genero']; //datos del campo email
// echo "$titulo, $autor, $genero. <br/>"; //visualizar datos
?>
<style>
.c1 {background-color:white; color:black; border:1px solid #F5F5F5 }
.c2 {background-color:Ghostwhite; color: black; border:1px solid #F5F5F5; cursor: pointer}
.c3 {color: blue; font-size:14px; font-weight:bold; font-family:Arial, Helvetica, sans-serif}
.c4 {color: black; font-size:12px; font-family:Arial, Helvetica, sans-serif}
.c5 {border:1px solid #F5F5F5 }
</style>
<table onMouseOver="this.className='c2'" onMouseOut="this.className='c1'" table width="900" align="center" cellspacing="1" class='c5' cellpadding="0" onClick="document.location.href='index.html'">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class ="c3" width="232" height="84" ><?php echo "  ".trim($titulo);?></td>
<td class ="c4" width="529" ><?php echo $autor;?> <div align="left"></div></td>
<td width="135" ><?php echo $genero;?><div align="right"></div></td>
</tr>
</table>
</tr>
</table>
<?php
} // fin del Wili
} // fin de funcion
espero que os sirva