This question already has an answer here:
hello guys please help me with my code in login process there's an error message
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
in line $_SESSION['userid'] = $row['userid'];
Here's my complete code of loginprocess:
session_start();
$message = "";
if(count($_POST) > 0){
$conn = mysql_connect("localhost", "root", "");
mysql_select_db("etransmittal", $conn);
$result = mysql_query("SELECT * FROM tbl_userlist WHERE username = '" . $_POST["username"] . "' AND user_password = '" . $_POST["password"] . "');
$row = mysql_fetch_array($result);
if(is_array($row)){
$_SESSION['userid'] = $row['userid'];
$_SESSION['username'] = $row['username'];
}
else{
$message = "Invalid username or password";
}
}
if(isset($_SESSION['userid'])){
header("location: userhomepage.php");
}
</div>