21,886
社区成员
发帖
与我相关
我的任务
分享
class UserEntity{
private $username;
private $password;
const userconst = "HuangYuHong"; //常量 用户名+常量再加密往数据库里插
function __construct($u,$p){
$this->username = $u;
$this->password = $p;
}
function register(){
//include("../DB/MySql.php");
echo md5(userconst); //12行 编译器说为定义 但是为什么还能输出
echo "|||";
echo md5(userconst); //14行
//$database = new MySql();
//$sql = "insert into user_table (username,password) values('".$username."','".$password."')";
//$database->setSQL($sql);
}
function logout(){
echo "注销";
}
function login(){
echo "登录";
}
function usercheck(){
echo "检查用户";
}
}
include("../bean/UserEntity.php");
if($_POST["submit"]){
$username = $_POST["username"];
$password = $_POST["password"];
$user = new UserEntity($username,$password);
$user->register();
}else{
echo "没有提交";
}