Nasıl php JQuery tarafından gönderilen veri çıkış görüyorsunuz?

0 Cevap php

Ben bu kod JQuery parça var. Ben wht php çıkışlarını görmek istiyorum. Bunu nasıl yazdırırım.

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<script>
$.ajax({
     url: "script.php",
     type: "POST",
     data: { name : "John Doe" },
     dataType: 'json',
     success: function(msg){
     alert(msg);
     }
});
</script>
<HTML>

script.php

<?php
$name = $_POST['name'];
echo $name;
?>

0 Cevap