I have a JQuery Mobile app i am building and i am using PHP and MySQL to register and Login.
I populated the database with a user and tried to login using the php script i wrote, however, i get the following error:
<br />
<b>Parse error</b>: syntax error, unexpected '}' in <b>/home/u426137825/public_html/login.php</b> on line <b>26</b><br />
I really don't understand this one.
Line 26 is the closing bracket after the IF statement checking the rows returned.
Here is my PHP code:
<?php
$email = TRIM($_REQUEST['email']);
$pword = TRIM($_REQUEST['password']);
if( isset($email) && isset($password)){
$pword = mysqli_real_escape_string($con, $pword);
$email = mysqli_real_escape_string($con, $email);
require('includes/dbcon.php');
$sql = mysqli_query($con, "SELECT ALL from users WHERE email = '$email' AND BINARY password = '$pword'");
$checkrows=mysqli_num_rows($sql);
$row = mysqli_fetch_array($sql);
}
$userID = $row('id');
$name = $row('username');
if($checkrow>0){
mysqli_close($con);
header("location:index.html#mapPage")
}
else{
$loginError = "Wrong Username or Pasword";
echo $loginError;
}
Any help on this issue would be appreciated.
Regards