这个页面是不是从其它页刷新过来的....而上一个页面又设置了coookie如果是..
你可以用meta refreash代替header

解决方案 »

  1.   

    贴出del.php的第13行和第48行附近的代码
      

  2.   

    <?php require_once('../Connections/conn1.php'); ?>
    <?php
    mysql_select_db($database_conn1, $conn1);
    $query_Recordset1 = "SELECT * FROM filelist";
    $Recordset1 = mysql_query($query_Recordset1, $conn1) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    $redir = "http://".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."?time=".time();
    if(isset($HTTP_POST_VARS['filename'])){
    $filename = "../img/";
    $delfile=$HTTP_POST_VARS['filename'];
    $filename .=$delfile;
    unlink ("$filename");
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;  switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    $deleteSQL = sprintf("DELETE FROM filelist WHERE filename=%s",
                           GetSQLValueString($delfile, "text"));
    mysql_select_db($database_conn1, $conn1);
    $Result1 = mysql_query($deleteSQL, $conn1) or die(mysql_error());
    echo "文件".$delfile."已经删除";
    $deleteGoTo = "" . $HTTP_POST_VARS['redir'] . "";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
      }
      header("Location: http://127.0.0.0/filmoo/upload/del.php?id=2");
    }
    ?>
      

  3.   

    到底那个提示是说明了什么问题呢?我的好多页面都有类似问题,asp的时候用redirect多好啊.
      

  4.   

    把这个echo "文件".$delfile."已经删除";抛弃!!
      

  5.   

    在调用header()的是前面不能出现echo,print等输出语句!!
    header()必须放在输出页面的一开始!这个关系到http协议的header部分!
      

  6.   

    注释掉
    echo "文件".$delfile."已经删除";
    或将其移到header后面
    $deleteGoTo = "" . $HTTP_POST_VARS['redir'] . "";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
      }
      header("Location: http://127.0.0.0/filmoo/upload/del.php?id=2");
    }
    echo "文件".$delfile."已经删除";
    ?>出错的原因是header前有输出
      

  7.   

    <?php require_once('../Connections/conn1.php'); ?>里有输出。
    不用header()用:
    <script>top.location.href='http://127.0.0.0/filmoo/upload/del.php?id=2';</script>
      

  8.   

    在调用header()的是前面不能出现echo,print等输出语句!!
    同时中间也不要有无谓的空格。
    header()必须放在输出页面的一开始!