<?php session_start(); include("Includes/header.php"); include("functions.php"); connect(); if(isset($_POST['login'])){ if(isset($_SESSION['uid'])){ echo "You are already logged in!"; }else{ $name = protect($_POST['name']); $password = protect($_POST['password']); $login_check = mysql_query("SELECT 'id' FROM 'user' WHERE 'name'='$name' AND 'password'='".md5($password)."'") or die(mysql_error()); if(mysql_num_rows($login_check) == 0) { echo "invalid Name or Password Combination!" }else{ $get_id = mysql_fetch_assoc($login_check); $_SESSION['uid'] = $get_id['id']; header("Location: main.php"); } } }else{ echo "You have visited this page incorrectly!"; } ?>
echo "invalid Name or Password Combination!"
<?php session_start(); include("Includes/header.php"); include("functions.php"); connect(); if(isset($_POST['login'])){ if(isset($_SESSION['uid'])){ echo "You are already logged in!"; }else{ $name = protect($_POST['name']); $password = protect($_POST['password']); $login_check = mysql_query("SELECT 'id' FROM 'user' WHERE 'name'='$name' AND 'password'='".md5($password)."'") or die(mysql_error()); if(mysql_num_rows($login_check) == 0) { echo "invalid Name or Password Combination!"; // add semi-colon here }else{ $get_id = mysql_fetch_assoc($login_check); $_SESSION['uid'] = $get_id['id']; header("Location: main.php"); } } }else{ echo "You have visited this page incorrectly!"; } ?>
echo "invalid Name or Password Combination!";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)