Rumah > Artikel > pembangunan bahagian belakang > 为何PHP不能接收。
为什么PHP不能接收。。
$.ajax({<br /> type: "POST",<br /> url: "index.php",<br /> data: "location=img_png_src",<br /> success: function(msg){<br /> alert( "Data Saved: " + msg );<br /> }<br /> });<br />
<?php echo $_POST["location"]; ?>
<?php<br />if($_SERVER['REQUEST_METHOD'] == "POST") {<br /> print_r($_POST);<br /> exit();<br />}<br />?><br /><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script><br /><script><br />$(function() {<br /> $.ajax({<br /> type: "POST",<br />// url: "index.php",<br /> data: "location=img_png_src",<br /> success: function(msg){<br /> alert( "Data Saved: " + msg );<br /> }<br /> });<br />});<br /></script><br />