Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/05/2011, 01:41
tonydx16
 
Fecha de Ingreso: febrero-2011
Mensajes: 233
Antigüedad: 13 años, 3 meses
Puntos: 4
Exclamación Intentando hacer una web modular =(

Estoy haciendo una web modular, ya hice con switch, pero no logro colocar una página de error cuando colocamos una direccion que no existe index.php?s=mxmxmxmxmxmx (que no sea default).

Intendando con este código, me sale todo bien, pero cuando ingreso a index.php me sale página no encontrada, o sea solo se puede asi index.php?s=xxxxxxx alguna ayuda para que si acepte y salga la pagina que quiero en index.php AYUDA!.



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(file_exists($URL.$ext))
{
include (
"index.html");
}


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>   
  
  '
; }


?>