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.