if(isset($_GET['delete'])) {
$ID = $_GET['delete'];
echo "
<script type='text/javascript'>
var ajax = new XMLHttpRequest();
var ajax.open('POST','parser.php', true);
ajax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
ajax.onreadystatechange = function () {
if(ajax.readyState ==4 && ajax.status == 200) {
alert(ajax.responseText);
}
}
ajax.send('delete=$ID')
</script>
";
}
这是我的代码,它应该将id发送到parser.php
这里是parser.php
<?php
if(isset($_POST['delete'])) {
echo $_POST['delete'];
}
没有收到来自parser.php的回复,有人可以帮忙吗? 所有答案都非常感谢