A condition in the php judgment statement is not written.
$ Username = trim ($ _ POST ['username']);
$ Password = trim (& _ POST ['pass']);
// Declare the SQL statement that will query the database
$ Query = "select top 6 * from WEB_VIEW where DNBH = '$ username' order by SFMonth desc ";
// Execute the SQL query and return records
$ Result = mssql_query ($ query) or die ("Data query failed:". mysql_error ());
$ NumRows = mssql_num_rows ($ result );
$ NRow = mssql_fetch_array ($ result );
If (empty ($ numRows) & $ password <> substr (row [3],-4) {echo "no data found. enter the user name and password correctly. Thank you! ";}
Else {
// Output result
}
Empty ($ numRows) & $ password <> substr (row [1]. lenth-3, 4) I mean when the query result is empty or the password entered by the user is compared with the row [1] Last 4 characters in the database, if not, an error prompt is output, ask the user to enter the user name and password again.
Error prompted during running, Parse error: syntax error, unexpected '[' in D: \ WWW \ test. php
Reply to discussion (solution)
Substr (row [3],-4)
Should be written
Substr ($ nRow [3],-4)
$ NumRows = mssql_num_rows ($ result );
$ NRow = mssql_fetch_array ($ result );
If (empty ($ numRows) | $ password <> substr (nRow [3],-4) {echo "no data found. enter the user name and password correctly. Thank you! ";}
I have already changed it.
Why do you always miss "$"