Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- application/config/form_validation.php
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- $config = array(
- 'signup/index' => array(
- array(
- 'field' => 'email_address',
- 'label' => 'Email Address',
- 'rules' => 'trim|required|max_length[255]|valid_email|email_in_use'
- ),
- array(
- 'field' => 'password',
- 'label' => 'Password',
- 'rules' => 'required|min_length[6]'
- ),
- array(
- 'field' => 'confirm_password',
- 'label' => 'Confirm Password',
- 'rules' => 'required|matches[password]'
- ),
- ),
- );
- application/controllers/signup.php
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Signup extends CI_Controller {
- public function __construct() {
- parent::__construct();
- }
- public function index() {
- if ($this->form_validation->run()) {
- $this->user_model->insert(array(
- 'email_address' => $this->input->post('email_address'),
- 'password' => $this->input->post('password'),
- ));
- redirect('/log-in');
- }
- $this->load->view('header');
- $this->load->view('signup/index');
- $this->load->view('footer');
- }
- }
- /* End of file signup.php */
- /* Location: ./application/controllers/signup.php */
Add Comment
Please, Sign In to add comment