登录类 用语开发过程中的方便性 类直接体现出来了 ,如果可以 我们可以建自己的一个类库 方便的时候 直接拿来用 提供编程效率
class chk{
private $name;
private $pwd;
public function __construct($x,$y){
$this->name=$x;
$this->pwd = $y;
}
public function chkuer(){
include 'conn/conn.php';
$rs = new com("adobd.recordset");
$rs ->open("select * from tb_user where username = ".$this->name."and userpwd = ".$this->pwd."",$conn,3,1);
if ($rs->eof||$rs->bof){
echo "cuowu";
}else {
echo "dengluchenggong";
}
}
}
?>
以上就是php用户登录面向对象类的内容,更多相关内容请关注PHP中文网(www.php.cn)!
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号