Answers for "sql query email and password of user"

SQL
0

sql query for login with email or username

if($_POST['username'] != '' && $_POST['password'] != ''){$name = $_POST['username'];$pass = md5($_POST['password']);$check_email = Is_email($name);if($check_email){// email & password combination$query = mysql_query("SELECT * FROM `users` WHERE `email` = '$name' AND `password` = '$pass'");} else {// username & password combination$query = mysql_query("SELECT * FROM `users` WHERE `username` = '$name' AND `password` = '$pass'");}$rows = mysql_num_rows($query);if($rows > 0){//successfull login$_SESSION['username'] = $name;} else {$msg = "Invalid Login Credentials";}mysql_close($connection);} else {$msg = "Please Provide All Details";}
Posted by: Guest on September-29-2020

Code answers related to "sql query email and password of user"

Code answers related to "SQL"

Browse Popular Code Answers by Language