jquery - Ajax GET but php variable is null -


i try send via ajax simple string, php var null. thank you

function postjson(){ $.ajax({ type: "get", url: "http://www.my-server.de/file.php", data: { 'datastring': "juhu" }, cache: false, success: function()     {         alert("order submitted");     },     error: function()     {         alert("error");     } }); 

php:

 <?php   echo "value is:";  echo $_get['datastring']; ?> 

maybe should try

$.ajax({    type: "get",    url: "http://www.my-server.de/file.php",    data: { 'datastring': "juhu" },    cache: false,    success: function( response ){        alert( response );    },    error: function() {        alert("error");    } }); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -