[javascript] javascript varible을 php 파일로 보내고 데이터베이스에 저장하는 방법 [닫힌]
The data must be key value pairs, use: $.ajax({ url : 'insert.php', type : 'POST', data : {name: name}, // or data: "name="+name, success : function(response) { console.log(response); } }); And the php side: $name = $_POST['name']; ------------------- Consider using something like: var name = "test"; $.ajax({ url : 'insert.php', type : 'POST', data : {'name' : name}, success : function(response)..