![]() |
Redirect after a form submission not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Redirect after a form submission not working (/showthread.php?tid=35582) |
Redirect after a form submission not working - El Forum - 11-03-2010 [eluser]Ray Julich[/eluser] I have an application with a form. Let's call it form.php. I submit the form to form.php, I verify it, I create a few flashdata variables and then redirect to another page to be processed. I am getting an error when I try to redirect the page. Here is the code once I've submitted the form: Code: $this->session->set_flashdata('field1',$this->input->post('field1')); Right now when I submit the form, I get a "The website cannot display the page" error page in my browser. The error is on the form.php, not on the redirect page. I have other pages in my application that use redirects and they work fine, but this is the only page in my application that uses flashdata. I did want to point out that I started use https in my application a few weeks ago and it seemed to have been working before I made that change. I don't know if it's related or not. Redirect after a form submission not working - El Forum - 11-03-2010 [eluser]tonanbarbarian[/eluser] is that the exact redirect statement you are using? because if it is that might not be a valid url unless you have a controller call new_page you are being a little vague with this and should provide the exact code so we can see what is really going on Redirect after a form submission not working - El Forum - 11-04-2010 [eluser]Ray Julich[/eluser] Sorry, I was pretty vague. I am working on a reservation system. A person fills out their criteria for reserving a laptop. Once the controller where the form resides verifies the information, it redirects to an available_resources controller, which will tell the user what laptop is available to reserves based on their criteria. Here is the actual code: Code: $this->session->set_flashdata('purpose',$this->input->post('purpose')); I have been viewing this in Internet Explorer, but I looked at this in Firefox yesterday. When looking at it in Firefox, it does redirect to the available_resource controller, but the page is blank. Redirect after a form submission not working - El Forum - 11-04-2010 [eluser]InsiteFX[/eluser] Code: $data = array( You may need to use: Code: $this->session->keep_flashdata($data); InsiteFX Redirect after a form submission not working - El Forum - 11-04-2010 [eluser]Ray Julich[/eluser] Stupid me. I've got it figured out. The "error" was happening when I was loading a custom model. In looking at the model, it was looking for POST data instead flashdata. Once I made that change, things are working again. |