DEVILLERS
Invité n'ayant pas de compte PHPfrance
10 oct. 2012, 21:19
Bonjour, se suis débutant en PHP et je ne suis pas sûr que ce script puisse fonctionner. Quelqu'un pourrait-il me corriger mes erreurs? Merci par avance.
<?php
$page = htmlentities($_GET['page']);
$pages = scandir('pages');
if(!empty($page) && in_array($_GET['page'].".php",$pages))
{
$content = 'pages/'.$_GET['page'].".php";
}
else
{
header("Location:index.php?page=login");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
<html>
<head>
</head>
<body>
<div id='content'>
<?php
include($content);
?>
</div>
</body>
</html>