本文整理汇总了PHP中Alert::return_error_div方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::return_error_div方法的具体用法?PHP Alert::return_error_div怎么用?PHP Alert::return_error_div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alert
的用法示例。
在下文中一共展示了Alert::return_error_div方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($type == 'log') {
$info = array('passed' => false, 'content' => '');
$validation = $validate->check($_POST, array('email' => array('required' => true), 'password' => array('required' => true)));
if ($validation->passed()) {
if ($validation->login_correct()) {
$info['passed'] = true;
//$info ['content']=Alert::correct_signup();
} else {
$info['content'] = Alert::return_error_div($validation->returnErrors());
}
} else {
$info['content'] = Alert::return_error_div($validation->returnErrors());
}
echo $info['content'];
// echo php_encode($info);
} else {
if ($type == 'sign') {
$validation = $validate->check($_POST, array('first_name' => array('required' => true), 'last_name' => array('required' => true), 'email' => array('required' => true, 'unique' => 'email', 'format' => 'email'), 'password' => array('required' => true, 'min' => 6)));
//connect to database if there are no errors
if ($validation->passed()) {
$instance = DB::getInstance();
$salt = Hash::salt(10);
$hashed_password = Hash::make($_POST['password'], $salt);
$instance->query('INSERT INTO user (email , password , salt , first_name , last_name ) VALUES (? , ? , ? , ? , ? )', array($_POST['email'], $hashed_password, $salt, $_POST['first_name'], $_POST['last_name']));
Alert::correct('You have successfully entered the data. Please check your e-mail to complete the sign-up.');
//send email functionality will come here
} else {
Alert::return_error_div($validation->returnErrors());
}
}
}