dqq9695
2016-03-24 23:10在javascript if语句中取消设置$ _POST
i need to unset $_POST['u'] but only inside a javascript function, now $_POST ARRAY unsets itself automatically after the page is ready...
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() {
}
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- Javascript将内容写入PHP var以在IF语句中使用不起作用[关闭]
- javascript
- php
- 1个回答
- Javascript:缺少; 在语句之前 - 转义错误
- javascript
- ajax
- php
- jquery
- 1个回答
- 在sql中失败的insert语句
- javascript
- sql
- mysql
- php
- 3个回答
- AJAX在while循环中干扰if语句?
- javascript
- ajax
- while-loop
- wordpress
- php
- 1个回答
- 我似乎无法在Javascript:S中使用if语句
- javascript
- ajax
- php
- 1个回答
换一换