EllisLab text mark
Advanced Search
2 of 2
2
   
POST data not being sent from a form to a controller
Posted: 15 October 2012 01:03 AM   [ Ignore ]   [ # 16 ]   [ Rating: 0 ]
Joined: 2012-08-21
88 posts

However, after following your suggestion to change it, as expected, no change, because the problem is not that submit isnt being posted, but that nothing seems to be posted, though if my guess of how form helper works, the equivalent of onsubmit is working.

 
Posted: 15 October 2012 04:59 PM   [ Ignore ]   [ # 17 ]   [ Rating: 0 ]
Joined: 2008-12-19
612 posts

No better suggestion on the problem, but which version of CI is being used here?

 Signature 

CI 2.1.3, Linux, LAMP. We also like Gold and Silver…
Blame the hammer, it is obviously the guilty party…
User Guide? Nobody told me there was a User Guide!

 
Posted: 15 October 2012 05:24 PM   [ Ignore ]   [ # 18 ]   [ Rating: 0 ]
Joined: 2012-08-21
88 posts

2.0.2, on ubuntu 12.04

 
Posted: 15 October 2012 05:47 PM   [ Ignore ]   [ # 19 ]   [ Rating: 0 ]
Joined: 2008-12-19
612 posts

Ok, I’m using 2.1.2-3 under Ubuntu 12.04 myself.
I’ve looked through the User Guide change log (http://ellislab.com/codeigniter/user-guide/changelog.html) and found these:

Ver. 2.0.3
form_open() now only adds a hidden (Cross-site Reference Forgery) protection field when the form’s action is internal and is set to the post method. (Reactor #165)

Ver. 2.1.1
Fixed a bug - form_open() compared $action against site_url() instead of base_url()

The second bug fix (2.1.1) may effect your situation, however, your code does call and execute the update controller method, which says (to me at least) that the path is correct.

The first bug fix (2.0.3) doesn’t appear to apply to your case, but I note in just in case.

I recall that there were a number of problems with version 2.0.2, which prompted version 2.0.3 and above.
Look at the change log and see if you recognize anything.

 Signature 

CI 2.1.3, Linux, LAMP. We also like Gold and Silver…
Blame the hammer, it is obviously the guilty party…
User Guide? Nobody told me there was a User Guide!

 
Posted: 15 October 2012 06:08 PM   [ Ignore ]   [ # 20 ]   [ Rating: 0 ]
Joined: 2012-08-21
88 posts

Thanks for the suggestion.  I had a quick search through with ctrl f, the one I thought it might of been, a problem with chrome not posting properly. However this was fixed in 2.0.2. I did actually encounter the second bug just yesterday with the home page suddenly loading relative to the site url and causing it to fail, but that resolved itself.

As for 2.0.3, are you able to enlighten me as to how that would cause issues, or what it means by a hidden protection field?

 
Posted: 15 October 2012 06:28 PM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Joined: 2008-12-19
612 posts

This is not related (I think) to your posting problem.  Note that since some of your forms work fine, so it’s probably a coding glitch somewhere. Still searching you code for that.

The CSRF has been incorporated into CI.  This is from the config file in 2.1.2-3

|—————————————————————————————————————
| Cross Site Request Forgery
|—————————————————————————————————————
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.

Since your system is 2.0.2, it DOES NOT have CSRF protections built into the core files.

NOTE: this is probably NOT related to the POST problem you are having, and right now, you don’t want to dig into what it would take to add CSRF to your 2.0.2 code.  I note it only because it is now part of the form helper library, added to fix the CSRF problem.  If you feel you need CSRF protection, then a rewrite under at least Ver 2.1.x would be you best option… after we fix the POST problem.

You can do a web search on “Cross Site Request Forgery” and find out about the problem,

 Signature 

CI 2.1.3, Linux, LAMP. We also like Gold and Silver…
Blame the hammer, it is obviously the guilty party…
User Guide? Nobody told me there was a User Guide!

 
2 of 2
2