【发布时间】:2023-03-03 17:46:02
【问题描述】:
当我运行这段代码时:
<?php
if (preg_match('/^[a-z0-9]+$/', $_GET['p'])) {
$page = realpath("includes/$_GET[p].php");
if ($page) {
include $page;
}
}
?>
我收到此错误:
注意:未定义的索引:第 3 行 index.php 中的 p
【问题讨论】:
标签: php undefined-index