php - AJAX call success but data not retrieved at server -
i have ajax call passes data php file, createtest2.php, below.
but createtest2.php file throws error
"notice: undefined index: aaa in c:\xampp\htdocs\testproj\test\createtest2.php on line 2
i have no clue how fix it.
caller.php
$(document).ready(function(){ $("#button_submit").click(function() { $.ajax({ type:"post", url:"createtest2.php", data:{aaa : "unit_test"}, success:function() { alert("success"); } }); }); });
createtest2.php
$test_name = $_post['aaa'];
if using $test_name = $_post['aaa']; have call ajax $(document).ready(function(){ $("#button_submit").click(function() { $.ajax({ type:"post", url:"createtest2.php", data:"aaa=unit_test", success:function() { alert("success"); } }); }); });
the main thing " data:"aaa=unit_test", "
Comments
Post a Comment