When closing the database, a syntax error is Prompted. for new users, thank you for Parse error: syntax error, unexpected T_OBJECT_OPERATOR in F: \ www \ study \ authmain. php on line.
Session_start ();
If (isset ($ _ POST ['userid']) & isset ($ _ POST ['password'])
{
$ Userid = $ _ POST ['userid'];
$ Password = $ _ POST ['password'];
$ Db_conn = new mysqli ('localhost', 'webauth ', 'webauth', 'auth ');
If (mysqli_connect_errno ()){
Echo 'connection to database failed: '. mysqli_connect_error ();
Exit ();
}
$ Query = 'select * from authorized_users where name = '. $ userid. "and password = sha1 (' $ password ')";
$ Result = $ db_conn-> query ($ query );
If ($ result-> num_rows)
{
$ _ SESSION ['valid _ user'] = $ userid;
}
$ Db_conn-> close ();
}
?>
Reply to discussion (solution)
Which line of error is prompted?
Indicate the wrong row number
Last line close
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in F: \ www \ study \ authmain. php on line 23
A semicolon is added at the end.
An error is written. there is an extra parenthesis, and the final parenthesis is removed.
An error is written. there is an extra parenthesis, and the final parenthesis is removed.
Thank you!