This is the previous paragraph, how to collect back-end PHP?
Please write me an example, as long as the output echo my name is XXX, my id is xxx on the line.
XXX changed to my JSON.
var aj = $.ajax({ url:'02.php', //data:nameStr+'&'+idStr, data:{ id : '1' , name : '二狗' }, type:'POST', dataType:'json', cache:false, success:aFunction, error : function() { $("div").append("异常!
"); }});
Reply content:
This is the previous paragraph, how to collect back-end PHP?
Please write me an example, as long as the output echo my name is XXX, my id is xxx on the line.
XXX changed to my JSON.
var aj = $.ajax({ url:'02.php', //data:nameStr+'&'+idStr, data:{ id : '1' , name : '二狗' }, type:'POST', dataType:'json', cache:false, success:aFunction, error : function() { $("div").append("异常!
"); }});
$id = $_POST['id'];$name = $_POST['name'];echo '我的名字是'.$name.',我的id是'.$id.'就行了..';
As with the $_post[key name]
PHP (' input://') input stream
Type: ' Post ' when using $_post
Type: ' Get ' when using $_get