javascript - What happens with data received by the server using ajax? -
one.php
:
html:
<button value="testvalue" name="foo">click</button>
javascript:
var keyvals = {foo:"bar"} $(function() { $("button").click(function() { $.ajax({ type:"post", url:"two.php", data: keyvals, success: function() { $("#center").append("<p>data transfer succeeded! </p>"); } }); }); });
now, happens data? how can use in two.php
? want save in file/database, why not save directly one.php
? i've tried following:
two.php
:
<?php var_dump($_request); ?>
comes out empty. happens data sent one.php
? how can use it?
strangely enough, i've looked @ every similar question find, , none of them answered properly, , of them downvoted. what's wrong question?
send data -
data: { value : $(this).val() },
on php access -
$value = $_post["value"];
Comments
Post a Comment