Hii folks I need your help to solve this problem .I m a beginner in php.. I m trying to add a forms to my website (html/css) but I always get this error.. hope you'll help me Ps: when I delete the line 32 it works but my DB still empty Below is my php code.
if ( isset($_POST['Nom']) || isset($_POST['Prenom']) || isset($_POST['Numero']) || isset($_POST['Service'])) {
$Nom =$_POST['Nom'];
$Prenom=$_POST['Prenom'];
$email=$_POST['email'];
$Numero=$_POST['Numero'];
$groupe=$_POST['Service'];
$message=$_POST=['message'];}
if (!empty($Nom) || !empty($Prenom) || !empty($email) || !empty($Numero) || !empty($Service) || !empty($message) )
{ $host="localhost";
$dbUsername="root";
$dbPassword="";
$dbname="teknicz";
//create connection
$conn=new mysqli($host,$dbUsername,$dbPassword,$dbname);
if (mysqli_connect_error()) {
die ('Connect Error ('.mysqli_connect_errno().')'.mysqli_connect_error());}
else {
$SELECT="SELECT email from registration Where email=? limit 1";
$INSERT="INSERT Into registration(Nom,Prenom,email,Numero,Service,message)values (?,?,?,?,?,?)";
//Prepare statement
$stmt=$conn->prepare($SELECT);
$stmt->bind_param("s",$email);
$stmt->execute();
$stmt->bind_result($email);
$stmt->store_result();
$rnum=$stmt->num_rows;
if ($rnum==0) {
$stmt->close();
$stmt=$conn->prepare($INSERT);
$stmt->bind_param("sssiss",$Nom,$Prenom,$email,$Numero,$Service,$message);
$stmt->execute();
echo"Demande Envoyée";
}
else {
echo "Email déjà utilisé";}
$stmt->close();
$conn->close();
}
} else {echo "Tous les champs sont nécessaires";
die();
}
?> ```