Cod: Selectaţi tot
// Daca as introduce aici exit(' "'. $_POST['motiv'] .'" '); imi afiseaza, de ce ?
$con=mysqli_connect("localhost","root","","login");
$result = mysqli_query($con,"SELECT * FROM utilizatori WHERE `username` = '$username'");
while($row = mysqli_fetch_array($result)){
if ($row['acces'] == 1 ) {
//...
} else if (empty($_POST) === false && empty($erori) === true) {
mysql_query("UPDATE `utilizatori` SET `acces` = -1, `motiv` = '". $_POST['motiv'] ."' WHERE `username` = '$username'");
header('Location: baneaza.php?succes');
exit();
}
}
}
if (isset($_GET['succes']) === true && empty($_GET['succes']) === true) {
$fisier = 'avertizari_h.php';
$mesaj = " <ul><li> >>> Utilizatorul '" . $date_utilizator['username'] . "' l-a banat pe '". $_POST['username'] ."' cu motivul '". $_POST['motiv'] . "'<<< </li></ul> \n"; // linia 58
file_put_contents($fisier, $mesaj, FILE_APPEND);
echo '
<link rel="stylesheet" href="css/bootstrap.min.css">
<a href="baneaza.php"><button class="btn btn-default">^ Inapoi ^</button></a><br><br>
<br />
<div class="alert alert-success">
<strong>Succes!</strong> Utilizatorul a fost banat! Motivul: "'. $_POST['motiv'] .'" // linia 65
</div>';
echo '<br>';
exit();
}
Cod: Selectaţi tot
Notice: Undefined index: username in C:\xampp\htdocs\login\baneaza.php on line 58
Notice: Undefined index: motiv in C:\xampp\htdocs\login\baneaza.php on line 58
Notice: Undefined index: motiv in C:\xampp\htdocs\login\baneaza.php on line 65