Small White (cont. 2)

Source: Internet
Author: User
I have table Tb_manager in my database, with Name (AL) and Pwd (AL) in my table, and I enter the name and PWD results in the login interface or:
The administrator name you entered is wrong, please re-enter!
Ask God for help to solve

 
  Name= $x;     $this->pwd= $y;    }   function Checkinput () {     include ("conn/conn.php");     Connect the data source          $sql = mysql_query ("select * from Tb_manager where name= '". $this->name. "' and pwd= '". $this->pwd. "'", $ conn);//echo "$sql";     $info =mysql_fetch_array ($sql);       Retrieves whether the administrator name and password are correct if     ($info ==false) {                    //If the administrator name or password is incorrect, then pop up the relevant message          echo "";          Exit;       }      else{                              //If the administrator name or password is correct, pop up the relevant message          echo ""; $_session[admin_name]= $info [name]; $_session[pwd]= $info [pwd];   } }}    $obj =new chkinput (Trim ($name), Trim ($pwd));      Create Object    $obj->checkinput ();              Call Class?>


Reply to discussion (solution)

$A _name=$_post[name]; User name to receive form submission
$A _pwd=$_post[pwd]; Receive password for form submission
$obj =new chkinput (Trim ($name), Trim ($pwd));

The great God still can't.
I tested it alone to connect to the Db_library database.
In the $sql= ..... Add a sentence below
Echo $sql;
The resource ID is returned #5

The ID corresponding to name and PWD is 22
I hope you can help me solve the problem

Your SQL is a connection resource
You're going to take out the SQL statements for the arguments and print them separately.

Three floor big God, I really is small white, only contact less than half a year, can say again concrete point, best can give an example, please

$A _name=$_post[name]; User name to receive form submission
$A _pwd=$_post[pwd]; Receive password for form submission
$obj =new chkinput (Trim ($A _name), trim ($A _pwd));

$obj =new chkinput (Trim ($name), Trim ($PWD)), which is the parameter that you instantiate the class in.
The parameters of the form form you receive are $a_name=$_post[name] and $A _pwd=$_post[pwd].
To instantiate an incoming parameter to a class:
$obj =new chkinput (Trim ($A _name), trim ($A _pwd))

7 Floor is me, this number is the third party Baidu account on, but not last time again, I applied for a box of SCDN account

Great gods, this is not a case-sensitive way to finish.

  • 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.