I am trying to create a new page that will bring up a form for them to enter a name for a group. It will then create the group and add them as a member to it. I have a similar sign up that I have copied and changed to fit the needs of this, but when I try to access it it gives me a 404 message.
I am accessing the controller (groups.php):
<?php
class Login extends CI_Controller {
function index() {
$this->load->view('includes/header');
$this->load->view('group_view');
$this->load->view('includes/footer');
$this->createGroup();
}
function createGroup() {
$this->load->library('form_validation');
// validation rules
$this->form_validation->set_rules('name', 'Name', 'trim|required');
if ($this->form_validation->run() == FALSE) { //didnt validate
$this->load->view('includes/header');
$this->load->view('group_view');
$this->load->view('includes/footer');
} else {
$this->load->model('model_groups');
if($query = $this->model_groups->createGroup()) {
//$data['account_created'] = 'Your account has been created.<br/><br/>You may now sign in.';
$this->load->view('includes/header');
$this->load->view('home_view');
$this->load->view('includes/footer');
} else {
$this->load->view('includes/header');
$this->load->view('group_view');
$this->load->view('includes/footer');
}
}
}
}
?>
I can post the model and view if necessary but Im pretty sure the problem is in the controller as that is what I am trying to load. Please let me know as soon as possible what my problem is! Thanks guys!