![]() |
form submit goes to wrong url - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: form submit goes to wrong url (/showthread.php?tid=36668) |
form submit goes to wrong url - El Forum - 12-10-2010 [eluser]SPeed_FANat1c[/eluser] Hi, I make a form opening: Code: echo form_open ('admin_/naujienos/redaguoti/'.$new_id.'/'.$offset); And when I press submit button it goes to url http://localhost/darzelis/admin_/naujienos0 I checked the source in browser, I have a good <form> tag Code: <form action="http://localhost/darzelis/admin_/naujienos/redaguoti/7/0" method="post"> I have only one form in my page. What is happening there? Maybe there is stupid mistake somewhere, I have no idea ![]() form submit goes to wrong url - El Forum - 12-10-2010 [eluser]Bart Mebane[/eluser] Code: <form action="http://localhost/darzelis/admin_/naujienos/redaguoti/7/0" method="post"> form submit goes to wrong url - El Forum - 12-11-2010 [eluser]SPeed_FANat1c[/eluser] No, I have only set route for default controller Code: $route['default_controller'] = "home"; Edit: Found whrere is the problem - it did not like the method 'redaguoti'. I changed to 'redaguoti2' and now it sends to correct url. So I just need another method for submission. I wanted to generate form and save data with the same method. The method looks like this: Code: function redaguoti($new_id,$offset) So initialy form_validation->run() will be false, so it generates the form. After we submit, form_validation->run() should be true and save the data. But I guess I'll have to make another method for submiting data. Just curious, why it cannot work in the way I did? |