input->post not working |
[eluser]zenonn[/eluser]
hi, I am new to CI, and seem to having a strange issue. I can use the $_POST var to get values from forms. As soon as I try to use input->post('var'), I get nothing to returned to the controller. Here is the code Controller: Code: function customer_insert() Code: <?php Code: <div id="form">
[eluser]TheFuzzy0ne[/eluser]
I can't see where you've opened your form... Am I missing something? EDIT: I take that back. I saw the fieldset first and assumed you didn't open the form, as fieldsets should be inside the form. EDIT2: OK, I think this has something to do with your nesting. You open a fieldset, then the form, but then you close the fieldset before the form. Switching the form_open, and form_fieldset should fix it?
[eluser]zenonn[/eluser]
Hello, Thanks for reply. I fixed the nesting problem and the issue still only sends $first_name,$last_name etc. I tried a form with no nesting and still getting just empty vars like this $email. Thanks
[eluser]TheFuzzy0ne[/eluser]
My suggestion would be to validate your page. Once you are sure it's valid HTML, it's a lot easier to troubleshoot.
[eluser]zenonn[/eluser]
I fixed the problem. I was putting '' quotes around the my post vars which turned them into strings. I feel real dumb. lol Thanks for the help Chris
[eluser]TheFuzzy0ne[/eluser]
Oh I see. I can't believe I didn't spot that. Well done for solving it. I'll bet you won't do that again in a hurry.
[eluser]zenonn[/eluser]
lol, that was the problem I was in hurry trying to do a simple thing. wasted 4 hours yesterday ouch . :blank:
[eluser]meigwilym[/eluser]
Just a suggestion for tidier code, put the post vars straight in your $data array. Code: $data = array(); Mei
|
Welcome Guest, Not a member yet? Register Sign In |