在删除数据之前显示确认消息时出现问题
if(isset($_POST['del'])){
echo "
<script>
var x;
x = confirm ('You want to proceed deleting?');
if(x == true){";
for($i=0;$i<$_SESSION['count'];$i++){
$checkbox = $_POST['checkbox'];
$del_id = $checkbox[$i];
$query = mysql_query("SELECT picture FROM tblreserve WHERE id='$del_id'");
while($row = mysql_fetch_assoc($query)){
$del_pic = $row['picture'];
}
$sql = "DELETE FROM tblreserve WHERE id = $del_id";
$result = mysql_query($sql);
if($result){
if(is_file($del_pic)){
unlink($del_pic);
}
}
}
header('location:view.php');
echo "}
else{
location.href = 'view.php';
}
</script>";
}