Questions about the Library Management System verification Administrator

Source: Internet
Author: User
Questions about the Library Management System validation Administrator
Little Brother Learning PHP in the research book a set of books on the management system of the source code I installed the WAMP5 integration environment I put the database into the MySQL Data folder and other configuration completed in the time of entry is the Login.php interface account password is correct, always prompt the account error The great God helps me to put out the Checklog code:

Session_Start ();
$A _name=$_post[name]; User name to receive form submission
$A _pwd=$_post[pwd]; Receive password for form submission

Class chkinput{//Defining classes
var $name;
var $pwd;

function Chkinput ($x, $y) {
$this->name= $x;
$this->pwd= $y;
}

function Checkinput () {
Include ("conn/conn.php"); Connecting to a data source
$sql =mysql_query ("select * from Tb_manager where name= '". $this->name. "' & pwd= '". $this->pwd. "'");
$info =mysql_fetch_array ($sql); Retrieving the administrator name and password is correct
if ($info ==false) {//If the administrator name or password is incorrect, the relevant message pops up
echo "";
Exit
}
else{//If the administrator name or password is correct, the relevant message pops up
echo "";
$_session[admin_name]= $info [name];
$_session[pwd]= $info [pwd];
}
}
}
$obj =new chkinput (Trim ($name), Trim ($pwd)); Creating objects
$obj->checkinput (); Call class
?>


------Solution--------------------
$obj =new chkinput (Trim ($name), Trim ($pwd)); Creating objects
There is no value in the $name, $pwd

$A _name=$_post[name]; User name to receive form submission
$A _pwd=$_post[pwd]; Receive password for form submission
You only $A _name, $A _pwd.

------Solution--------------------
You haven't seen it yet.
$obj =new chkinput (Trim ($name), Trim ($pwd));
$A _name

What to do? Change to the same.
  • 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.