There is a condition that will not be written.
$username =trim ($_post[' username ');
$password =trim (&_post[' Pass ');
Declare the SQL statement that would 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 ("Query data 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, please enter the user name and password correctly. Thank you!
";}
else {
Output results
}
Empty ($numRows) && $password <> substr (row[1].lenth-3,4) I mean, when the query result is empty or the user enters the password and the row[1 in the database] the last 4 characters are compared, If it is not, the error message is output, allowing the user to enter the user name and password again.
Runtime prompt error, Parse error:syntax error, unexpected ' [' in D:\WWW\test.php
Reply to discussion (solution)
SUBSTR (Row[3],-4)
should be written as
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, please enter the user name and password correctly. Thank you!
";}
I've changed it.
Why do you always miss "$"?