Tema: Categorias
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 28/05/2005, 13:54
Zaki
 
Fecha de Ingreso: mayo-2005
Mensajes: 21
Antigüedad: 19 años
Puntos: 0
Codigo de la paguina para mostrar:
Cita:
<?
include('config.php');
if (!isset($cat)){?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">
<p class="titulo-seccion">Lista de Categorias:</p>
</div></td>
</tr>
<?
$sql = "SELECT *";
$sql.= "FROM categorias";
$rs = mysql_query($sql, $con);
if(mysql_num_rows($rs)>0)
{
?>
<tr>
<td><div align="center">
<p class="casella"><br>
<?
while($cat = mysql_fetch_array($rs)){
$id_cat = $cat['id'];
$titulo_cat = $cat['nombre'];
print "·<a href=\"categorias.php?cat=$titulo_cat\">$titulo_ca t</a><br><br>";
}
?>
</p>
</div></td>
</tr>
<?
}
?>
</table>
<?
}
if (isset($cat)){
$sql = "SELECT *";
$sql.= "FROM subcategorias WHERE categoria=$cat";
$rs = mysql_query($sql, $con);
if(mysql_num_rows($rs)>0)
{
while($sub = mysql_fetch_array($rs)){
$nombre_sub = $sub['nombre'];
$categoria = $sub['titulo'];
$descripcion_sub = $sub['content'];
$id_sub = $sub['id'];
print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
print "<p class=\"menor\">--><a href=\"categorias.php\">Indice</a>/<a href=\"categorias.php?cat=$titulo_cat\">$titulo_ca t</a><br><br>";
print "<p class=\"titulo-seccion\">$nombre_sub</p>";
print "</td></tr></table>";
}
}
}
?>
Se tiene que hacer el archivo config.php i si kieres le puedes poner k salgan las descripciones. Despues faltaria poner todo lo de las descargas, pero creao k es un pokillo mas complocado.

Espero k te sirva :)