how to access the data i posted through ajax on my controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: how to access the data i posted through ajax on my controller (/showthread.php?tid=68712) |
how to access the data i posted through ajax on my controller - Lestah - 08-16-2017 Code: $.ajax({ and this is my controller Code: public function identifying_usertype() RE: how to access the data i posted through ajax on my controller - InsiteFX - 08-16-2017 Maybe $this->input->post('name'); RE: how to access the data i posted through ajax on my controller - skunkbad - 08-16-2017 (08-16-2017, 09:15 AM)InsiteFX Wrote: Maybe $this->input->post('name'); A little background on this question ... it comes from a stack overflow question that I was trying to help Lestah with. If he posts to the Welcome controller, then $this->input->post('name') works, but if he posts to any other controller then $this->input->post('name') returns NULL. It's very bizarre. Have you heard of such a thing? RE: how to access the data i posted through ajax on my controller - InsiteFX - 08-16-2017 Nope, the only thing I can think of is maybe he needs to clean his web browsers cache out. If he specify's the correct controller then it should post to it. Ahhh, look at his ajax url, he is only using single qoutes Code: // should be like this. Not sure if that's the problem but it should be like I showed. RE: how to access the data i posted through ajax on my controller - skunkbad - 08-16-2017 (08-16-2017, 11:31 AM)InsiteFX Wrote: Nope, the only thing I can think of is maybe he needs to clean his web browsers cache out. We spent a lot of time trying to figure this out yesterday. Didn't suggest cleaning the browser cache, but jumped through a lot of hoops: https://stackoverflow.com/questions/45704888/how-can-i-check-if-i-got-the-value-from-my-ajax-to-my-controller/45705168?noredirect=1#comment78372679_45705168 RE: how to access the data i posted through ajax on my controller - ciadvantage - 08-16-2017 Would you check your form if the email input with 'attribute' name='email' and password input name='password'? Code: <form> then in the controller: Code: public function identifying_usertype() Try that code and see if you see the response. I m pretty sure you should! Good luck |