-3
i $ _POST unset gerekiyorsa [ 'u'] ama sadece bir javascript fonksiyonu, sayfa hazırdır sonra otomatik kendisi unsets şimdi $ _POST DİZİ ... içeride
function resetChat(cod_c){
if(confirm('are you sure?')){
if (sendReq.readyState == 4 || sendReq.readyState == 0) {
sendReq.open("POST", 'getChat.php?chat='+cod_c+'&last=' + lastMessage, true);
sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
sendReq.onreadystatechange = handleResetChat;
var param = 'action=reset';
param += '&user=' + document.getElementById('cod_user').value;
sendReq.send(param);
document.getElementById('txt_message').value = '';
}
<?php unset($_POST['u']); ?> // this only 1 time after confirm???
}
}
function handleResetChat() {
}
, @bordeux tarafından belirtildiği gibi - php sunucu tarafında iken javascript, istemci tarafındadır (çoğunlukla). php akışını kontrol etmek için javascript kod mantığını kullan – RamRaider