本文整理汇总了PHP中student::setPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP student::setPassword方法的具体用法?PHP student::setPassword怎么用?PHP student::setPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类student
的用法示例。
在下文中一共展示了student::setPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_student
private function create_student($row)
{
$obj = new student();
$obj->setstudentId($row["student_Id"]);
$obj->setFirstName($row["FirstName"]);
$obj->setLastName($row["LastName"]);
$obj->setDob(new \DateTime($row["dob"]));
$obj->setGender($row["gender"]);
$obj->setUsername($row["UserName"]);
$obj->setPassword($row["password"]);
$obj->setapproved($row["approved"]);
return $obj;
}
示例2: savepass
protected function savepass()
{
$required = array("current" => "Current Password", "new" => "New Password");
foreach ($required as $key => $value) {
if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
echo $value . ' is Required<br/>';
return;
}
}
global $user;
global $objPDO;
$student = new student($objPDO, $user->getuserId());
if (md5($_POST['current']) == $student->getPassword()) {
$student->setPassword(md5($_POST['new']));
$student->save();
} else {
echo 'The Current Password is Wrong';
return;
}
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/profile"/>';
}