Im a beginner, just started diving into sessions and logins. I have this bit off code that i am struggeling with.
Code: Select all
<?php
include '../includes/functions.php';
if(isset($_POST['login'])) {
if(isset($_POST['username'])) {
if(isset($_POST['password'])) {
$username = $_POST['username'];
$query = mysql_query ("SELECT * FROM users WHERE Username = '$username'") or die mysql_error());
$user = mysql_fetch_array($query);
if(md5($_POST['password']) == $user['Password'] {
echo "Login successful";
$_SESSION['user'] = $user['Username'];
header("Location: index.php");
} else {
echo "Please check your login details!";
include('login.php');
}
} else {
echo "Please check your password!";
include('login.php');
}
} else {
echo "Please check your username!";
include('login.php');
}
} else {
echo "Please check that you filled out the login form!";
include('login.php');
}
?>
Code: Select all
Parse error: syntax error, unexpected T_STRING in dologin.php on line 7 Thanks in advance to those who can help me out alittle on the way.
Greetings from Norway!