I have a Controller called Register
that looks like this:
class Register extends CI_Controller
{
public function index()
{
$this->load->view('register');
}
public function create()
{
$this->load->library('form_validation');
//set rules here
if ($this->form_validation->run() == TRUE)
{
//everything checks out
}
else
{
$this->load->view('register');
}
}
}
The view contains a form that posts to register/create
.
My problem is, when I go to localhost/register
and fill out the form incorrectly, the form reloads, but the url is now:
localhost/register/register/create
If I enter it incorrectly again
localhost/register/register/register/create
and so on...
I'm guess this is an htaccess
and I've tried using some standard CodeIgniter htaccess files available online, but none fix this issue. I'm using this on a WAMP server.
EDIT
The view file only consists of the form, for now. I prefer using direct HTML instead of the CodeIgniter Form helper.
<form id="register_form" method="post" action="register/create" title="Create an Account">
<!-- input fields -->
</form>