我通过 jquery ajax 从每个函数发送数据来覆盖/写入文件时遇到问题。我认为我的 post.php 不正确可以帮助我使用此功能吗?
$('.mod').each(function(){
var id = $(this).attr('id');
$.ajax({
type: "POST",
url: "post.php",
data: "divid="+id+"&length="+$('.mod').length+"&ok=1",
success: function(msg){ }
});
});
if($_POST['ok']==1){
$File ='index.php';
$Handle = fopen($File, 'w');
$length = $_POST['length'] ;
fwrite($Handle, ''.$_POST['divid'].'<br>');
fclose($Handle);
}
问候弗兰克