I get a 403 error when running the form from the first part of this tutorial.
I contacted my host after researching and suspecting a mod_security limitation, they tell me I'm hitting an internal redirect limit of 10. The error is below. They say they won't support development but I suspect that since I'm using the template files that it's their environment causing the problem.
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://mywebsite.com/automation/codeigniter/form
How can I find the cause of the redirect loop, or otherwise fix my 403 error?
Edit: the URL from the tutorial has me going to http://mywebsite.com/includes/codeigniter/index.php/form
The form...
<html>
<head>
<title>My Form</title>
</head>
<body>
<?php echo validation_errors(); ?>
<?php echo form_open(base_url('controllers/form.php')); ?>
<h5>Username</h5>
<input type="text" name="username" value="" size="50" />
<h5>Password</h5>
<input type="text" name="password" value="" size="50" />
<h5>Password Confirm</h5>
<input type="text" name="passconf" value="" size="50" />
<h5>Email Address</h5>
<input type="text" name="email" value="" size="50" />
<br><br>
<div><input type="submit" value="Submit" /></div>
</form>
<?php echo form_close() ?>
</body>
</html>
The controller...
<?php
class Form extends CI_Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}
}
?>
Note CodeIgniter user a Front Controller.
Check that .htaccess of root of Codeigniter dir does not restrict http POST i.e.
deny from all
If there is no .htaccess, check in parent dir's where this limit might be inherited, since htaccess rules are applied recursively.