Ajax Request - 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: Ajax Request (/showthread.php?tid=11075) |
Ajax Request - El Forum - 08-27-2008 [eluser]uptime[/eluser] [quote author="Nutan Lade" date="1219790109"]Here in the Ajax call I am sending a value userId.I need this value to enter into db.But when I am using $_post['userId'] I am getting an error and it is Undefined index: userId[/quote] First of all, you should use $_POST[] instead of $_post[] (uppercase). If it still doesn't work, keep reading... * Are you sure you're sending it as post (and not get)? * Do you have that AJAX page online? * Are you sure the field name is userId? (this is case-sensitive ! ) Add this line BEFORE that line in which you try to use "$_post['userId']": Code: var_dump($_POST); exit; Ajax Request - El Forum - 08-27-2008 [eluser]Nutan Lade[/eluser] I tried both the cases.i.e upper and lower case. still the same error A PHP Error was encountered Severity: Notice Message: Use of undefined constant userId - assumed 'userId' when using this code it was returing array(0){} Code: var_dump($_POST); exit; Code: function submitMovie(movieId){ and the server code is Code: function addMovie(){ it was returning hi and array(0){} Ajax Request - El Forum - 08-27-2008 [eluser]uptime[/eluser] Do you see any errors on the Error Console or in Firebug's console? Ajax Request - El Forum - 08-28-2008 [eluser]Nutan Lade[/eluser] I didn't find any error in firebug console Ajax Request - El Forum - 08-28-2008 [eluser]uptime[/eluser] Does it work without AJAX? Ajax Request - El Forum - 08-29-2008 [eluser]Nutan Lade[/eluser] Yes it is working without ajax.When I am making direct request to the server. And I had one more problem with this have a look at the code: Code: function addMovieName(){ on the server Code: function addMovieByName(){ I am getting error in the console prototype is not defined. |