php에서 ajax 질문
본문
<html>
<head>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<form action="" method="POST">
<div>
<label for="id">id</label>
<input type="text" name="id" id="id">
</div>
<div>
<label for="pv">pv</label>
<input type="password" name="pv" id="pv">
</div>
<div>
<label for="pb">pb</label>
<input type="password" name="pb" id="pb">
</div>
<div>
<label for="code">code</label>
<input type="text" name="code" id="code">
</div>
<div>
<label for="email">email</label>
<input type="text" name="email" id="email">
</div>
<div>
<input type="submit" class="button">
</div>
</form>
<script>
$(function(){
$(".button").click(function(){
let values = $("form").serialize();
$.ajax({
url: "./insert_update.php",
type: "POST",
data: values,
dataType: "json",
success: function(response){
alert("성공");
}
});
});
});
</script>
</html>
이코드로 넘겼을때 받는 php에서 $id = $_POST['id'];를 해서 받을수가 없는데...
어떻게 해야하는건가요 ㅠㅠ?
!-->
답변을 작성하시기 전에 로그인 해주세요.