Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/05/2011, 08:33
Avatar de s00rk
s00rk
 
Fecha de Ingreso: octubre-2010
Ubicación: Mexico
Mensajes: 238
Antigüedad: 13 años, 6 meses
Puntos: 48
Respuesta: Intentando hacer una web modular =(

Solamente hacer un check si el $URL esta vacio no hacer nada

Código PHP:
<?php

$URL       
$_GET['s'];
$ext      ".html";
$Pagina  $URL.$ext;

if (
$URL == "xxxxxxxxxxxxxxxxxx"){  
   
$Descripcion ='xxxxxxxxxxxxxxxxxxxxxxxx';
   
$Titulo    ='xxxxxxxxxxxxxxxxxxx';
   
$Keyw    ='xxxxxxxxxxxxx';
 }


elseif (
$URL == "xxxxxxxxxxxxxxxxxxxxxxx"){ 
   
$Descripcion ='xxxxxxxxxxxxxxxxxxxxxxxx';
   
$Titulo    ='xxxxxxxxxxxxxxxxxxx';
   
$Keyw    ='xxxxxxxxxxxxx';
 }

// y asi con todas mis páginas

if(empty($URL))
{
    if(
file_exists("./".$Pagina))
    {
        include (
$Pagina);
    }else {
        echo 
'
  
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta name="robots" conte="noindex,nofollow" />
        <title>Página no encontrada</title>
        </head>

        <body>Error 404: Página no encontrada
        </body>
        </html>   
      
          '

    }
}
?>