注意:未定义的变量:nom_variable在C:\wamp\www\project\index.php中的14ca 此错误是什么意思以及如何修复它?
foreach ($array as $item) {未设置计数变量,在本例中为错误 未定义变量 appears.
// 做某事
$count++;
}
$count=0;例 2:
foreach ($array as $item) {
// 做某事
$count++;
}
session_start();不要忘记使用 session_start() 否则,服务器将无法识别和读取变量 $_SESSION.
// 推荐解决方案
$nom = $_SESSION['nom_utilisateur'];
if (empty($nom_user)) $nom_user = '';
或者
// 将变量设置在 index.php
$nom = '' 的开头;
$nom = $_SESSION['nom_utilisateur'];
或
$nom = $_SESSION['nom_utilisateur'];
if (!isset($nom_user)) $nom_user = '';
Please disable your ad blocker and refresh the window to use this website.