CodeIgniter Forums

Full Version: CodeIgniter User Guide Version 1.7.2 not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I am trying learn how to setup a form to do simple validation. I am following the CodeIgniter User Guide Version 1.7.2 ( its just not working. I even copied the views and controller directly from the tutorial but when I hit the submit button it refreshes. Its not showing errors and when everything is filled out it doesn't go to the success page. I am new to CI and could be doing something wrong, but I just don't see it.



class Form extends Controller {
    function index()
        $this->load->helper(array('form', 'url'));
        $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)

<title>My Form</title>
<?php echo validation_errors(); ?>

<?php echo form_open('form'); ?>

&lt;input type="text" name="username" value="" size="50" /&gt;

&lt;input type="text" name="password" value="" size="50" /&gt;

<h5>Password Confirm</h5>
&lt;input type="text" name="passconf" value="" size="50" /&gt;

<h5>Email Address</h5>
&lt;input type="text" name="email" value="" size="50" /&gt;

<div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>



El Forum

I figured it out.

My base_url was going to "" but I have my domain set to redirect to "". So when the form was submitting is was going to the domain without the "www". Once I changed the base_url with the "www" it worked.

El Forum

Summer - I had the exact same problem and your solution worked for me - thanks for posting it!