关于header的问题 这个页面是不是从其它页刷新过来的....而上一个页面又设置了coookie如果是..你可以用meta refreash代替header 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 贴出del.php的第13行和第48行附近的代码 <?php require_once('../Connections/conn1.php'); ?><?phpmysql_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");}?> 到底那个提示是说明了什么问题呢?我的好多页面都有类似问题,asp的时候用redirect多好啊. 把这个echo "文件".$delfile."已经删除";抛弃!! 在调用header()的是前面不能出现echo,print等输出语句!!header()必须放在输出页面的一开始!这个关系到http协议的header部分! 注释掉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前有输出 <?php require_once('../Connections/conn1.php'); ?>里有输出。不用header()用:<script>top.location.href='http://127.0.0.0/filmoo/upload/del.php?id=2';</script> 在调用header()的是前面不能出现echo,print等输出语句!!同时中间也不要有无谓的空格。header()必须放在输出页面的一开始! php header实现下载 下载时页面上的其它链接不能打开 必须先下载完或停止下载 请问php中如何处理嵌套的正则 php要如何做判断? 非常非常急用!! linux 系统下php加载xmlrpc模块? 请教一个php递归读取服务器硬盘分区、目录的源代码 本人在湛江,现有一中小项目需外包,详情请电13536383607 php调用mssql的存储过程无法同时返回输出参数和结果集??请教!!! 请问数据导入问题! 关于类的一些问题 大神帮看看点拨一下 在red linux中jdk和tomcat放在哪里? 个人空间的权限问题,大家都来帮帮忙吧,我快急死了。
<?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");
}
?>
header()必须放在输出页面的一开始!这个关系到http协议的header部分!
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前有输出
不用header()用:
<script>top.location.href='http://127.0.0.0/filmoo/upload/del.php?id=2';</script>
同时中间也不要有无谓的空格。
header()必须放在输出页面的一开始!