I made a login registration little thing from each other, but once I log in with letters, an error is reported.

Source: Internet
Author: User
I made a login registration little thing myself, but once I log in with a letter, an error is reported first. the code is the login Action code under the controller // login submit controller & nbsp; & nbsp; public & nbsp; function & nbsp; logAction () & I made a small login registration item, but once I log in with a letter, an error is reported.
Code First

This is the login Action code under the controller.

// Log in and submit the controller
Public function logAction ()
{
// Obtain the login form parameters
$ Userid = $ this-> getRequest ()-> getParam ('userid ');
$ Password = $ this-> getRequest ()-> getParam ('psd ');
// Create a table model and query the logon password
$ Table = new user ();
$ Where = 'userid = '. $ userid;
$ Row = $ table-> fetchRow ($ where)-> toArray ();
// Verify the form password and database password
If ($ row ['password'] = $ password)
{
// Create a global variable session username id
Session_start ();
$ _ SESSION ['userid'] = $ userid;
// View of successful login
$ This-> render ('logok ');
}
Else
{
// Logon failure view displayed due to incorrect password
$ This-> render ('logfailed ');
}
}

This is the user table.
+ -------- + ---------- +
| Userid | username | password |
+ -------- + ---------- +
| 010 | messi | 010 |
| Robin | test | robin |
+ -------- + ---------- +

First, the registration process is normal. both records can be inserted normally.

However, it is normal to log on with the first record at 010 during login.
An error occurred while logging in with the second record robin !! Error 500: An error occurred Application error

However, if I enter a username and submit a form with a letter, the system will report an error without letters and numbers, but will not report any jump information.
First, I analyzed the reason why there was no jump when I wrote the username and password at will, because the returned value of fetchRow is null.

But why do I report an error once I write an English character ??
There should be no problem in getting form parameters. The Table model should be okay.
Page character set mysql character set zend studio character set is also unified to UTF-8
Is the $ where condition written incorrectly? but it is successfully redirected by using a number to log on.
Why is there such a strange problem?

I also tested the 010_010 character string that does not contain any special characters. The Error 500 is returned after the string is submitted.
This is really a strange issue .. share it:
------ Solution --------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.