• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ajax Request

#22
[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){
  //    alert(movieId);
    var url = "<?=base_url()?>index.php/gadgets/addMovie/"+movieId;
        
        var msgBox = "movieLink_"+movieLink;

        new Ajax.Request(url, {
        method: 'post',
        parameters: {userId: 1},
        onComplete: function(addmovie){
          var response = addmovie.responseText || "no response text";
          document.getElementById(msgBox)[removed] = response;        
        },
        onFailure: function(){ alert('Something went wrong...') }
          });
  }

and the server code is
Code:
function addMovie(){
        echo "hi";        
        var_dump($_POST); exit;
        //echo $_POST[userId];
        
    }

it was returning hi and array(0){}


Messages In This Thread
Ajax Request - by El Forum - 08-25-2008, 10:05 AM
Ajax Request - by El Forum - 08-25-2008, 10:35 AM
Ajax Request - by El Forum - 08-25-2008, 11:33 AM
Ajax Request - by El Forum - 08-25-2008, 11:40 AM
Ajax Request - by El Forum - 08-25-2008, 11:41 AM
Ajax Request - by El Forum - 08-26-2008, 09:44 AM
Ajax Request - by El Forum - 08-26-2008, 09:51 AM
Ajax Request - by El Forum - 08-26-2008, 09:52 AM
Ajax Request - by El Forum - 08-26-2008, 10:03 AM
Ajax Request - by El Forum - 08-26-2008, 10:04 AM
Ajax Request - by El Forum - 08-26-2008, 10:07 AM
Ajax Request - by El Forum - 08-26-2008, 10:51 AM
Ajax Request - by El Forum - 08-26-2008, 10:55 AM
Ajax Request - by El Forum - 08-26-2008, 11:01 AM
Ajax Request - by El Forum - 08-26-2008, 11:05 AM
Ajax Request - by El Forum - 08-26-2008, 12:35 PM
Ajax Request - by El Forum - 08-26-2008, 12:40 PM
Ajax Request - by El Forum - 08-26-2008, 12:44 PM
Ajax Request - by El Forum - 08-26-2008, 12:50 PM
Ajax Request - by El Forum - 08-26-2008, 02:50 PM
Ajax Request - by El Forum - 08-27-2008, 09:30 AM
Ajax Request - by El Forum - 08-27-2008, 12:27 PM
Ajax Request - by El Forum - 08-27-2008, 12:32 PM
Ajax Request - by El Forum - 08-28-2008, 11:31 AM
Ajax Request - by El Forum - 08-28-2008, 11:34 AM
Ajax Request - by El Forum - 08-29-2008, 11:44 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.