I have this login codings.
which it have a parsing error at line 9 which starts from the $query.
can anyone help? i have problems with parsing errors. :(
which it have a parsing error at line 9 which starts from the $query.
can anyone help? i have problems with parsing errors. :(
Code:
<?php
session_start ();
$username = $_POST['username'];
$password = $_POST['password'];
$link = mysqli_connect ($HOST,$USERNAME,$PASSWORD,$DB);
$query = "SELECT id,username, FROM StarGazer WHERE username='"$username."'AND password = SHA1 ('".$password."')";$result = mysql_query($link,$query) or die (mysqli_error($link));
if (mysqli_num_rows($result) == 1) {
$row = mysqli_fetch_array($result);
$_SESSION['user_id'] = $row['id'];
$_SESSION['username'] = $row['username'];
$msg = '<p><i>You are logged in as '.$SESSION['username'].'<br/><a href="index.php">Home</p>';
}else {
$msg = <p class ="error"> Sorry, you must enter a valid username and password to log in. <a href ="login.html">Back</a></p>;
}
?>
Comment