0
<?php
session_start();
include('config.inc');

$login = mysqli_query("SELECT * FROM user WHERE (username = '" .     mysqli_real_escape_string($_POST['username']) . ['password']) and mysqli_real_escape_string($_POST['password']) . "');

if (mysql_num_rows($login) == 1){
$_SESSION('username') = $_POST('username');
header('Location: index.html');
}

else{
header('Location: index.php');
}
?>

In this code I'm getting "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\phpmysimplelogin\loginproc.php on line 15" this error. Where am I doing wrong?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • You have an unmatched " on line 5 toward the end of the line. – Alderin Jul 07 '16 at 18:57
  • 1
    I count at least 5 errors, and there might even be more. Confusing `(` with `[` at least two places, quotes being misused and wrong concatenating of strings. I suggest you use an editor with syntax-highlighting, that will help you. – Qirel Jul 07 '16 at 18:57
  • Hey man, Thanks, I'm new but need to fix it. Could you help me out? – Kamruzzaman Limon Jul 07 '16 at 19:12

0 Answers0