0
我已經開始建立這個類的,我想註冊一個用戶:爲什麼它返回Success
PHP變化的變量
$user = User::register($_POST['username'],$_POST['email'],$_POST['password'],$captcha,$agree);
if(empty($user->errors)) {
echo 'Success';
} else {
echo 'Failed';
}
:
<?php
class User {
protected $_id;
protected $_name;
protected $_email;
protected $_password;
public $isLogged = false;
public $errors = array();
public function __construct() {
}
public static function register($username,$email,$password,$captcha,$agree) {
$user = new self;
array_push($user->errors,'Error!');
}
}
我這樣稱呼它?我做過array_push
!
你沒有返回任何東西在'註冊()' – jprofitt