mardi 28 juin 2016

Undefined text in lines 6,9 and 10. Why am I getting this error? [duplicate]

This question already has an answer here:

t1 has username,

t2 has password.

The page from which this is redirected has another field t3, which compares t2 and t3.

This error started appearing only after adding this t2 and t3 comparison

removal of the t3 check makes this work again.

<?php
$con = mysqli_connect("localhost","root","","company");
if(mysqli_connect_errno()){
    echo "Could not connect.";
}
$query = "SELECT * FROM login_info WHERE suser = '{$_POST['t1']}'"; //line 6
$queryArray = mysqli_fetch_array(mysqli_query($con,$query));
if(empty($queryArray['suser'])){
    echo "<h2 style='font-size: 40px;'><br><br><br><br><center><font face=Papyrus color=#425A87 style='text-shadow: 0px 0px 7px white;'>Welcome, user ".$_POST['t1'].". This is your first login to this website.</font></center></h2>"; //line 9
    mysqli_query($con,"INSERT INTO login_info VALUES ('{$_POST['t1']}','{$_POST['t2']}')");  //line 10
} 
else{
    echo "<h2 style='font-size: 40px;'><br><br><br><br><center><font face=Papyrus color=#425A87 style='text-shadow: 0px 0px 7px white;'>Welcome back ".$_POST['t1']."</font></center></h2>";
}
mysqli_close($con);     
require_once 'display.php';
?>

Aucun commentaire:

Enregistrer un commentaire