dimanche 5 avril 2020

I struggle with using if else with header on php [duplicate]

Here is my code, when I didn't use header location it worked, but now, it always goes to erreurinscription.php

<?php
require "connexion.php" ;
$newlogin=$_POST['login'] ;
$newpass=$_POST['pass'] ;
$quer="insert into users values('$newlogin','$newpass');" ;
mysqli_query($con,$quer);
if(mysqli_query($con,$quer)==false)
    header('location:erreurinscription.php') ;
else
    header('location:allproduits.php') ;
?>

Aucun commentaire:

Enregistrer un commentaire