Hello,
i'm trying to do a check to see if the textboxes on my php form are empty I tried this code
Code:
if(isset($_POST['submit']) ) {
if ($name="" && $gotdate="" && $paydate="" && $money="" && $number="" && $info="") {
include('scripts/connect.php');
$name = $_POST['name'];
$gotdate = $_POST['gotdate'];
$paydate = $_POST['paydate'];
$money = $_POST['money'];
$number = $_POST['number'];
$info = $_POST['info'];
$sql = "INSERT INTO customers (name, gotdate, paydate, money, number, info)
VALUES ('$name','$gotdate','$paydate','$money','$number','$info')";
$result = mysql_query($sql);
echo "<h3>Thank you, Information Saved!.</h3> $form";
}
else
echo "You need to fill in all the fields!<br>. $form ";
}
else
echo $form;
Even when I fill in all the fields I still get an error saying You need to fill in all the fields! can anyone help please?