Hello I have been having some issues when using(trying to use) an if statement within my php program, I have looked at tutorials and didnt really understand, so I'm looking for someone to understand where I've gone wrong.
I am making a login system for my computer science project and would like to validate the username and password which then moves onto another page or displays an error message. I understand my code isnt the best but im only a beginner.
<?php
$username = "username";
$password = "password";
$hostname = "localhost";
error_reporting(E_ALL); ini_set('display_errors', 1);
//connection to phpmyadmin
$dbhandle = mysqli_connect($hostname, $username, $password, '1012405') or die("Unable to connect to MySQL");
$sqlLogin = "SELECT * FROM users WHERE email='".$_POST['email']."'
AND password='".$_POST['email']."'
";
$log = mysqli_query($dbhandle,$sqlLogin) or die("Unable to insert to login");
if $sqlLogin > 0{
header('Refresh: 3; url=stockInputForBusiness.html');
} else{
echo"Incorrect Credentials";
}
?>