This code doesnt get into the if statements to check the conditions. Please help me find what is wrong with it.
<?php
$info="";
if (isset($_POST['RegButton']))
{
$FirstName= $_POST['Fname'];
$LastName= $_POST['Lname'];
$Email= $_POST['Email'];
$Phone= $_POST['Phone'];
$userPass= $_POST['password'];
$repass= $_POST['repassword'];
//For password encryption
$slt= time();
$salt= $slt;
$harshed= sha1($userPass.$salt);
if (empty($_POST['Fname'])){
$info= "The first name field cannot be blank!, Please fill all blanks";
}elseif (empty($_POST['Lname'])){
$info= "The last name field cannot be blank!, Please fill all blanks";
}elseif (empty($_POST['Email'])){
$info= "The email field cannot be blank!, Please fill all blanks";
}elseif (empty($_POST['Phone'])){
$info= "The phone number field cannot be blank!, Please fill all blanks";
}elseif (!is_numeric($_POST['Phone'])){
$info= "You've not entered a phone Number";
}elseif ($userPass != $repass){
$info= "Password does not match";
}
if(!filter_var($_POST['Email'], FILTER_VALIDATE_EMAIL)){
$info= "Invalid Email Address";
}
include ("conn.php");
if (!empty($_POST['Fname']) && !empty($_POST['Lname']) && !empty($_POST['Email']) && !empty($_POST['Phone'])){
$sql= "INSERT INTO tbreg (Firstname, Lastname,Email, phone,salt, harshed) VALUES ('$FirstName', '$LastName', '$Email', '$Phone','$salt','$harshed')";
$result= mysql_query($sql);
if ($result=1)
{
$info= "Succesfully Saved!, You will receive an email containning your login credentials and an activation link to activate your email.";
}else
{
$info= "There was an during submission";
}
}
}
?>