我还是个新手。话虽如此,我的网站有一个消息系统,允许用户删除他们发送的消息。发现如果我从“已发送”框中删除我的邮件,它会从收件人收件箱中删除邮件。我有两种方法可以从您发送的邮件中删除邮件,“删除所有邮件”和一一删除。
这是我的全部擦除代码:
function deleteAll() {
var answer = confirm('Are you sure you want to delete all of your messages?');
if(answer){
return true;
}else{
return false;
}
}
if(isset($_POST['subEraseAll'])){
$query = "UPDATE `Messages` SET `status` = 'dead' WHERE `sentFrom` = '".$auth->id."'";
mysql_query($query,$connection) or die(mysql_error());
<div class="EraseAll">
<form name="EraseAll" action="SentMail.php" method="post" onsubmit="return deleteAll();">
<input type="submit" name="subEraseAll" value="Erase All Messages" />
</form>
</div>
下面是通过deleteConfirmPage一一删除消息的代码:
$message = $_GET['id'];
$query = "SELECT * FROM `Messages` WHERE `id` = '" . $message . "'";
$request = mysql_query($query,$connection);
$result = mysql_fetch_array($request);
$toUser = $result['sentTo'];
$fromUser = $result['sentFrom'];
if($auth->id !=$fromUser) {
header("Location: index.php");
exit;
}
$query = "UPDATE `Messages` SET `status` = 'dead' WHERE `id` = '".$message."' LIMIT 1";
$request = mysql_query($query,$connection);
那么,如何阻止我的查询从收件人收件箱中删除已发送邮件中的已发送邮件?