javascript - Cannot pass values into a php function -


i having trouble passing in value or array of values php script. when submit button on page clicked, following function executes:

$('#rangesubmit').click( function (e) {         e.preventdefault();         $.ajax({             type: 'post',             url: 'http://.../test.php',             data: {test1:"done"},             success: function(data)             {                 $("#mydiv").html(data);             }     }); }); 

the php script looks this:

<?php      echo $argv[1]; //should return first item in array of values passed php function?     var_dump($_server['argv']);  ?>   

and script returns "null" instead of value sent script. ideas?

$argv[1] reference parameter passed command line, like:

php page.php argument 

this call page.php "argument" parameter can acessible $argv[1].

to post variables use $_post[$name]. in case use:

echo $_post['test1']; 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -