Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public function login() {
  2.  
  3. if ($this->request->is('post')) {
  4. if ($this->Auth->login()) {
  5. return $this->redirect();
  6. }
  7. $this->Session->setFlash('Incorrect user or password.');
  8. }
  9. }
  10.  
  11. <h1>Access with your username:</h1>
  12. <?php
  13. echo $this->Form->create('User', array('action' => 'login'));
  14. echo $this->Form->input('username', array('label' => 'User:'));
  15. echo $this->Form->input('password', array('label' => 'Password:'));
  16. echo $this->Form->end('Login');
  17. ?>
  18.  
  19. <div>
  20. <?php
  21. echo $this->Form->create('user', array('action' => 'login'));
  22. echo $this->Form->input('username', array('placeholder' => 'User', 'label' => false));
  23. echo $this->Form->input('password', array('placeholder' => 'Password', 'label' => false));
  24. echo $this->Form->submit('Ingresar', array('div' => true));
  25. echo $this->Form->end();
  26. ?>
  27. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement