categoria.php
Código PHP:
  
<h1>Categorias</h1>
<?php
$consulta = mysql_query("SELECT * FROM sn_categorias", $db_link)or die(mysql_error);
 
echo "<ul>";
echo "<li><a href='index.php'>Todas</a>";
while($row = mysql_fetch_array($consulta))
    {
    echo "<li><a href='?categoria=$row[catCategoria]&id=$row[cat_ID]'>$row[catCategoria]</a></li>";
    }
echo "</ul>";
?>    Código PHP:
   <?php 
if(isset($_GET['id']) && $_GET['categoria'])
    {
    $categoria_ID = $_GET['id'];
    $categoria = $_GET['categoria'];
    $clausula = "WHERE notCategoriaID = '$categoria_ID'";
    
    $titulo = "Noticias en la categoria $categoria";
    }
else
    {
    $titulo = "Todas las noticias";
    }
@$consulta = mysql_query("SELECT * FROM sn_noticias $clausula", $db_link)or die(mysql_error);//lA CONSULTA SE ARMA SEGUN CRITERIO MENU
 
echo "<h2>$titulo</h2>";
while($filaNoticia = mysql_fetch_array($consulta))
    {
    echo "<a href='?categoria=$filaNoticia[notTitulo]&categoria=$filaNoticia[notTexto]&id=$filaNoticia[notTitulo]'><h3>$filaNoticia[notTitulo]</h3></a>";// SE PONEN LOS LINKS CON RESEÑA QUE TE REDIGIRIRAN
    
    echo nl2br("$filaNoticia[notTexto]"); 
    }
    
?>    Código PHP:
   --
-- Base de datos: `sistemanoticias`
--
 
-- --------------------------------------------------------
 
--
-- Estructura de tabla para la tabla `sn_categorias`
--
 
CREATE TABLE IF NOT EXISTS `sn_categorias` (
  `cat_ID` int(11) NOT NULL AUTO_INCREMENT,
  `catCategoria` varchar(100) NOT NULL,
  PRIMARY KEY (`cat_ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;
 
 
--
-- Estructura de tabla para la tabla `sn_noticias`
--
 
CREATE TABLE IF NOT EXISTS `sn_noticias` (
  `not_ID` int(11) NOT NULL AUTO_INCREMENT,
  `notTitulo` varchar(255) NOT NULL,
  `notTexto` text NOT NULL,
  `notCategoriaID` int(11) NOT NULL,
  PRIMARY KEY (`not_ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ; 
    Código PHP:
  
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />    
    <title>Sistema de Noticias - por C-Mushroom Plus</title>
    <link rel="stylesheet" href="estilo.css" type="text/css" media="screen" />
</head>
 
<?php include('conexion.php'); ?>
<?php include('header.php'); ?>
<div style = "float:left; width: 23%;">
    <?php include('categoria.php'); ?>
    <?php include('admin.php'); ?>
</div>
<div style = "float:left; width: 54%;">
    <?php include('noticia.php'); ?>
</div>
<div style = "float:right; width: 23%;">
    <?php include('list-imagenes.php'); ?>
    <center>
        <br><br>
        <img src="imagenes/cosplay-jade-mileena-mortal-kombat.jpg" width="194" height="271">
        <br><br>
          <img src="imagenes/Hannah Minx .jpg" width="194" height="290"></center>
 
</div>
</body>
</html>    
 

 construir link dinamico o como se llama esto?¿
 construir link dinamico o como se llama esto?¿ 


 
 

