from post goes from index.php/form to index.php?form |
[eluser]coderex[/eluser]
Hi, I've just starting learning CI and from the form example in codeigniter when I post, apart from no validation messages it goes from http://mysite.com/codigniter/index.php/form to http://mysite.com/codigniter/index.php?form which displays a completely different page, not the form, why is it showing ? ,?. I think there's some sort of config issue, can anyone give me a hand please? ## controller example in code igniter <?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'); } } } ?> <html> <head> <title>My Form</title> </head> <body> ## myform <?php echo validation_errors(); ?> <?php echo form_open('form'); ?> <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" /> <div><input type="submit" value="Submit" /></div> </form> </body> </html> ## form success <html> <head> <title>My Form</title> </head> <body> <h3>Your form was successfully submitted!</h3> <p><?php echo anchor('form', 'Try it again!'); ?></p> </body> </html> |
Messages In This Thread |
from post goes from index.php/form to index.php?form - by El Forum - 03-09-2011, 03:10 AM
from post goes from index.php/form to index.php?form - by El Forum - 03-09-2011, 04:56 AM
from post goes from index.php/form to index.php?form - by El Forum - 03-09-2011, 07:33 AM
from post goes from index.php/form to index.php?form - by El Forum - 03-09-2011, 09:01 AM
from post goes from index.php/form to index.php?form - by El Forum - 03-09-2011, 11:14 AM
|