Problem with some POST data - 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: Problem with some POST data (/showthread.php?tid=53122) |
Problem with some POST data - El Forum - 07-11-2012 [eluser]Alhazred[/eluser] In my application all the forms use the method POST, all of them works fine but one. I have a link on a page, this link calls a controller's function, this function only loads a page. Inside this page there is a form Code: <form id='moduserdata' name='moduserdata' method='post' action='<?php echo base_url().'users/mod_pers_data_act' ?>'> The problem is that if I try to print echo $this->input->post('nome'); or any other field, nothing appears. The form's action is correct because if I replace the echo above with echo "blabla"; that appears. The POST data look to don't arrive to the method, which could be the reason? Problem with some POST data - El Forum - 07-11-2012 [eluser]rip_pit[/eluser] Can you try to print with Code: $_POST['yourfield]; Code: $this->input->post(‘nome’); you'll see if the post contains data or not. Replace the full html tag with the form_helper method Code: $this->load->helper('form'); A quick way to debug posts is to enable debugger : Code: $this->output->enable_profiler(TRUE); Problem with some POST data - El Forum - 07-11-2012 [eluser]CroNiX[/eluser] I don't think your form action is correct as you say it is. Have you looked at the raw html it produces? Too many single quotes... Code: action="<?php echo base_url('users/mod_pers_data_act'); ?>" Problem with some POST data - El Forum - 07-11-2012 [eluser]InsiteFX[/eluser] Maybe if you show your whole form we might be able to help. This is why I love FireFox and FireBug lol. Problem with some POST data - El Forum - 07-11-2012 [eluser]Alhazred[/eluser] Here is the form code, I've left only one field, it doesn't work anyway Code: <?php Code: public function mod_pers_data_act() Problem with some POST data - El Forum - 07-11-2012 [eluser]CroNiX[/eluser] It doesn't work because of all of your single quotes within single quotes, like I pointed out earlier. You are also using form_open() improperly. It automatically inserts the base url, so you probably have that showing up twice. You just tell it the segments. Code: form_open('users/mod_pers_data_act'); Although, that won't help where you are (again) improperly using single quotes, such as your submit input. Problem with some POST data - El Forum - 07-11-2012 [eluser]Alhazred[/eluser] Thanks it works now. |