Hi, try to declare these parameters but it seems to cause me an error, originally they were all mysql and I changed them to mysqli. Could you tell me where I'm wrong?
LINES OF THE CODES THAT CAUSE THE ERROR
$sql2=mysqli_query("SELECT * FROM usuarios WHERE Correo='$username'");
if($f2=mysqli_fetch_array($sql2)){</code>
$sql=mysqli_query("SELECT * FROM prueba WHERE Correo='$username'");
if($f=mysqli_fetch_array($sql)){</code>
The code is a login that identifies email and password written with the BDD
require('conexion/conex.php');
$username=$_POST['mail'];
$pass=$_POST['pass'];
$sql2=mysqli_query("SELECT * FROM usuarios WHERE Correo='$username'");
if($f2=mysqli_fetch_array($sql2)){
if($pass==$f2['pasadmin']){
echo '<script>alert("BIENVENIDO ADMINISTRADOR")</script> ';
echo "<script>location.href='admin.php'</script>";
}
}
$sql=mysqli_query("SELECT * FROM prueba WHERE Correo='$username'");
if($f=mysqli_fetch_array($sql)){
if($pass==$f['Contraseña']){
header("Location: index2.php");
}else{
echo '<script>alert("CONTRASEÑA INCORRECTA")</script> ';
echo "<script>location.href='index.php'</script>";
}
}else{
echo '<script>alert("ESTE USUARIO NO EXISTE, PORFAVOR REGISTRESE PARA PODER INGRESAR")</script> ';
echo "<script>location.href='index.php'</script>";
}