Notice: Undefined variable: nom_variable in C:\wamp\www\project\index.php on line 14ca what does this error mean and how do I fix it?
foreach ($array as $item) {The count variable was not set, and in this case the error Undefined variable appears.
// do something
$count++;
}
$count=0;Example 2:
foreach ($array as $item) {
// do something
$count++;
}
session_start();Don't forget to initialize the session with session_start() otherwise the server will not be able to identify and read the variables $_SESSION.
// recommended solution
$nom = $_SESSION['nom_utilisateur'];
if (empty($nom_user)) $nom_user = '';
Or
// set the variable at the beginning of index.php
$nom = '';
$nom = $_SESSION['nom_utilisateur'];
Or
$nom = $_SESSION['nom_utilisateur'];
if (!isset($nom_user)) $nom_user = '';
Please disable your ad blocker and refresh the window to use this website.