Problem with some POST data |
[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?
[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);
[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'); ?>"
[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.
[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()
[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.
|
Welcome Guest, Not a member yet? Register Sign In |