note 57346 deleted from function.file-exists by tularis
| From: | tularis@php.net | Date: | Fri, 30 Sep 2005 22:40:36 +0000 |
| Subject: | note 57346 deleted from function.file-exists by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96104@lists.php.net to get a copy of this message | ||
Note Submitter: davividal at siscompar dot com dot br
Reason: useless
----
what do you think about this code?
<?php
define("HTML","html/");
$extensoes=array(0=>'php',1=>'html',2=>'htm');
if(IsSet($_GET["lnk"]))
{
$lnk=$_GET["lnk"];
$existe=0;
foreach($extensoes as $ext)
{
if (file_exists(HTML.$lnk.".".$ext))
{
$pagina=$lnk.".".$ext;
$existe=1;
break 1;
}
}
if ($existe)
{
require(HTML.$pagina);
}
else
{
require(HTML."404.php");
}
}
?>
works fine for me!! ^_^