Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CodeIgniter uses index.php
- RewriteEngine On
- RewriteCond %{REQUEST_URI} ^/system.*
- RewriteRule ^(.*)$ index.php?/$1 [L]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.+)$ index.php?/$1 [L]
- $config['index_page'] = "";
- public function index()
- {
- $this->load->helper(array('form', 'url'));
- $this->load->model('Registration_Model');
- $this->load->library('form_validation');
- $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
- $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|callback_username_check|xss_clean');
- $this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[6]|max_length[12]|matches[passconf]');
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
- $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|callback_email_check');
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('registration');
- }
- else
- {
- //input data into database here
- $username = strtolower($_POST['username']);
- $password = md5($_POST['password']);
- $email = strtolower($_POST['email']);
- $data = array
- (
- 'username' => $username,
- 'password' => $password,
- 'email' => $email
- );
- $this->Registration_Model->addUser($data);
- $this->load->view('registrationsuccess');
- }
- }
- RewriteEngine on
- RewriteCond $1 !^(index.php|robots.txt|images|css|js|user_guide)
- RewriteRule ^(.*)$ /index.php/$1 [L]
Add Comment
Please, Sign In to add comment