Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //avoid Undefined variable
- $errors = [];
- if (Input::exists('post'))
- {
- $validate = new Validate;
- $validation = $validate->check($_POST, array(
- 'username' => array(
- 'required' => true
- ),
- 'password' => array(
- 'required' => true
- )
- ));
- if ($validation->passed())
- {
- $data = $this->_model->get_member_hash(Input::get('username'));
- if (Password::password_verify(Input::get('password'), $data[0]->admin_password))
- {
- echo 'correct data';
- }
- else
- {
- echo 'incorrect data';
- }
- }
- else
- {
- $errors = $validation->errors();
- }
- public function get_member_hash($username)
- {
- return $this->_db->read('SELECT * FROM ' . DATABASE_PREFIX . 'admins WHERE admin_email=:email OR admin_username=:username', array(
- ':email' => $username,
- ':username' => $username,
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement