Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $this->load->library('form_validation');
  2.  
  3. $this->form_validation->set_rules('username','User Name','required|alpha|trim');
  4. $this->form_validation->set_rules('password','Password','required');
  5.  
  6. $this->form_validation->set_error_delimiters("<p class='text-danger'>","</p>");
  7.  
  8. echo $username=$this->input->post('username');
  9. echo $password=$this->input->post('password');
  10.  
  11. if( $this->form_validation->run() )
  12. {
  13. $this->load->view("success");
  14. }
  15. else
  16. {
  17. $this->load->view("login");
  18. }
  19.  
  20. <?php echo form_input(['name'=>'username','class'=>'form-control','placeholder'=>'USERNAME','value'=>set_value('username')]); ?>
  21. <?php echo form_error('username'); ?>
  22. <?php if( $error = $this->session->flashdata('login_failed1')): ?>
  23. <?= $error ?>
  24. <?php endif; ?>
  25.  
  26. <?php echo form_password(['name'=>'password','class'=>'form-control','placeholder'=>'PASSWORD','value'=>set_value('password')]); ?>
  27. <?php echo form_error('password'); ?>
  28. <?php if( $error = $this->session->flashdata('login_failed')): ?>
  29. <?= $error ?>
  30. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement