Quand je lance ce code:Pourquoi est-ce que j'obtiens un "index indéfini" de mon PHP?
<?php
if (preg_match('/^[a-z0-9]+$/', $_GET['p'])) {
$page = realpath("includes/$_GET[p].php");
if ($page) {
include $page;
}
}
?>
Je reçois cette erreur:
Notice: Undefined index: p in index.php on line 3
duplication possible de [PHP: "Remarque: Undefined variable" et "Notice: Undefined Index"] (http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined- index) – Jocelyn