Am I doing this wong? |
[eluser]pdxbenjamin[/eluser]
I've used CI for awhile now and this always bugged me. In the View a simple form... Code: <form action="form_do" method="post"> And in the Controller... Code: function form_do() But whenever I do a form processing action the url that is returned is going to be http://site.com/controller/form_do/ even though I'm actually still on 'index' for this example. Is this correct or am I just not getting it?
[eluser]CroNiX[/eluser]
Use the form helper, form_open('controller/segment');, or, DON'T use a relative path in your form action (or css asset, or image, or javascript, or.... Relative paths get appended to the end of the current URL, but that's just a regular HTML issue. Code: echo form_open('form_do'); Code: <form action="<?php echo site_url('form_do'); ?>" method="post"> |
Welcome Guest, Not a member yet? Register Sign In |