根据不同情况跳到不同页面的问题 在使用header的时候前头已经有HTML之类的语句输出了,提示说得很明白headers already sent by... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 feyge(菲戈..原来天空真的不止井口这么大呀~) 这我也看懂一点,就是不知我的代码里在哪里出了问题(已经有HTML之类的语句输出了), <?php session_start();?><?php if (isset($_SESSION['username'])): { if ($_SESSION['username']=="shining"): else: {$msg=$_SESSION['username']."你不是管理员无权进行管理!!"; header("Location:msg.php?msg=$msg");} endif;} else: {$msg="你还没有登陆系统,请先登陆系统!!"; header("Location:userlogin.php?msg=$msg");} endif;?><?php require_once('Connections/localhost.php'); ?> 第13行:<?php $currentPage = $HTTP_SERVER_VARS["PHP_SELF"];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;}if ((isset($HTTP_GET_VARS['Asset_ID'])) && ($HTTP_GET_VARS['Asset_ID'] != "")) { $deleteSQL = sprintf("DELETE FROM assettb WHERE Asset_ID=%s", GetSQLValueString($HTTP_GET_VARS['Asset_ID'], "text")); mysql_select_db($database_localhost, $localhost); $Result1 = mysql_query($deleteSQL, $localhost) or die(mysql_error()); $deleteSQL1 = sprintf("DELETE FROM nominateassettb WHERE Asset_ID=%s", GetSQLValueString($HTTP_GET_VARS['Asset_ID'], "text")); mysql_select_db($database_localhost, $localhost); $Result2 = mysql_query($deleteSQL1, $localhost) or die(mysql_error());}if ((isset($HTTP_GET_VARS['AssetID'])) && ($HTTP_GET_VARS['AssetID'] != "")) { $selectSQL = sprintf("select * FROM nominateassettb WHERE Asset_ID=%s", GetSQLValueString($HTTP_GET_VARS['AssetID'], "text")); mysql_select_db($database_localhost, $localhost); $Result1 = mysql_query($selectSQL, $localhost) or die(mysql_error()); $totalRows=mysql_num_rows($Result1); if ($totalRows==0): {$strSql=sprintf("insert into nominateassettb select * from assettb WHERE Asset_ID=%s", GetSQLValueString($HTTP_GET_VARS['AssetID'], "text")); mysql_select_db($database_localhost, $localhost); $Result1 = mysql_query($strSql, $localhost) or die(mysql_error()); $msg="编号为".$HTTP_GET_VARS['AssetID']."的资产推荐成功!!"; header("Location:msg.php?msg=$msg");} else: { $msg="编号为".$HTTP_GET_VARS['AssetID']."的资产已经被推荐过!!";第70行: header("Location:msg.php?msg=$msg"); } endif;}$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];}$maxRows_Recordset1 = 10;$pageNum_Recordset1 = 0;if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) { $pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;if((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")){if ($selectsort=="请选择"): $selectsort="";else:endif;if (isset($selectkind)):else: $selectkind="";endif;if ($selectprovince=="请选择"): $selectprovince="";else:endif;if ($selectstate="请选择"): $selectstate="";else:endif;if (($textfloot0=="") && ($textfloot1=="")): $str0="Asset_Floot>0";elseif((!($textfloot0=="")) and ($textfloot1=="")): $str0="Asset_Floot>=trim($textfloot0)";elseif(($textfloot0=="") and (!($textfloot1==""))): $str0="Asset_Floot<=trim($textfloot1)";elseif((!($textfloot0=="")) and (!($textfloot1==""))): $str0="Asset_Floot>=trim($textfloot0) and Asset_Floot<=trim($textfloot1)";endif;if ((($selectYear0=="年") or ($selectMonth0=="月") or ($selectDay0=="日")) And (($selectYear1=="年") or ($selectMonth1=="月") or ($selectDay1=="日"))): {$str1="Asset_Floot>0";}elseif ((($selectYear0!="年") or ($selectMonth0!="月") or ($selectDay0!="日")) And (($selectYear1=="年") or ($selectMonth1=="月") or ($selectDay1=="日"))): {$str1="Asset_Upto>=trim('$selectYear0-$selectMonth0-$selectDay0')";}elseif ((($selectYear0=="年") or ($selectMonth0=="月") or ($selectDay0=="日")) And (($selectYear1!="年") or ($selectMonth1!="月") or ($selectDay1!="日"))): {$str1="Asset_Upto<=trim('$selectYear1-$selectMonth1-$selectDay1')";}elseif ((($selectYear0!="年") or ($selectMonth0!="月") or ($selectDay0!="日")) And (($selectYear1!="年") or ($selectMonth1!="月") or ($selectDay1!="日"))): {$str1="Asset_Upto>=trim('$selectYear0-$selectMonth0-$selectDay0') and Asset_Upto<=trim('$selectYear1-$selectMonth1-$selectDay1')";}endif;}mysql_select_db($database_localhost, $localhost);if((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")): {$query_Recordset1 = "SELECT * FROM assettb Where Asset_ID like trim('%$textnumber%') and Asset_Name like trim('%$textname%') and Asset_Sort like trim('%$selectsort%') and Asset_Kind like trim('%$selectkind%') and Asset_State like trim('%$selectstate%') and Asset_Province like trim('%$selectprovince%') and $str0 and $str1 and Asset_Bank like trim('%$textbank%') order by RIGHT(Asset_ID,8)";}else: {$query_Recordset1="SELECT * FROM assettb";}endif;$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $localhost) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) { $totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$queryString_Recordset1 = "";if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . implode("&", $newParams); }}$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?>以上是包括13到70行的代码点击推荐的那一行:点击推荐的那一行: <td ><a href="assetsearch.php?AssetID=<?php echo $row_Recordset1['Asset_ID'];?>">推荐</a></td>请高手帮我看看 请问如何根据更改图片的排名来移动图片的位置啊! 关于HTML标签中特殊字符的问题 unlink不能删除中文文件名的文件 如何保存网站来路信息 网站备案要求提供个人身份证等信息,会不会泄露个人信息? php + javascript 验证验证码 php 自动提交表单登录读取数据 如何实现 这个问题怎么解决 为什么我的下载总不能成功,在线等~~急 $$$请教mail()函数的怪现象,一定给分!! 请大家帮我看一下文件上传的代码! 100分相送!!!! 为什么在php中用post传递的数据内容会附加在地址后面?
这我也看懂一点,就是不知我的代码里在哪里出了问题(已经有HTML之类的语句输出了),
<?php if (isset($_SESSION['username'])):
{ if ($_SESSION['username']=="shining"):
else:
{$msg=$_SESSION['username']."你不是管理员无权进行管理!!";
header("Location:msg.php?msg=$msg");}
endif;}
else:
{$msg="你还没有登陆系统,请先登陆系统!!";
header("Location:userlogin.php?msg=$msg");}
endif;?>
<?php require_once('Connections/localhost.php'); ?>
第13行:<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];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;
}
if ((isset($HTTP_GET_VARS['Asset_ID'])) && ($HTTP_GET_VARS['Asset_ID'] != "")) {
$deleteSQL = sprintf("DELETE FROM assettb WHERE Asset_ID=%s",
GetSQLValueString($HTTP_GET_VARS['Asset_ID'], "text")); mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($deleteSQL, $localhost) or die(mysql_error());
$deleteSQL1 = sprintf("DELETE FROM nominateassettb WHERE Asset_ID=%s",
GetSQLValueString($HTTP_GET_VARS['Asset_ID'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result2 = mysql_query($deleteSQL1, $localhost) or die(mysql_error());}if ((isset($HTTP_GET_VARS['AssetID'])) && ($HTTP_GET_VARS['AssetID'] != "")) {
$selectSQL = sprintf("select * FROM nominateassettb WHERE Asset_ID=%s",
GetSQLValueString($HTTP_GET_VARS['AssetID'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($selectSQL, $localhost) or die(mysql_error());
$totalRows=mysql_num_rows($Result1);
if ($totalRows==0):
{$strSql=sprintf("insert into nominateassettb select * from assettb WHERE Asset_ID=%s",
GetSQLValueString($HTTP_GET_VARS['AssetID'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($strSql, $localhost) or die(mysql_error());
$msg="编号为".$HTTP_GET_VARS['AssetID']."的资产推荐成功!!";
header("Location:msg.php?msg=$msg");}
else:
{ $msg="编号为".$HTTP_GET_VARS['AssetID']."的资产已经被推荐过!!";
第70行: header("Location:msg.php?msg=$msg");
}
endif;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;if((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")){
if ($selectsort=="请选择"):
$selectsort="";
else:
endif;
if (isset($selectkind)):
else:
$selectkind="";
endif;
if ($selectprovince=="请选择"):
$selectprovince="";
else:
endif;
if ($selectstate="请选择"):
$selectstate="";
else:
endif;
if (($textfloot0=="") && ($textfloot1=="")):
$str0="Asset_Floot>0";
elseif((!($textfloot0=="")) and ($textfloot1=="")):
$str0="Asset_Floot>=trim($textfloot0)";
elseif(($textfloot0=="") and (!($textfloot1==""))):
$str0="Asset_Floot<=trim($textfloot1)";
elseif((!($textfloot0=="")) and (!($textfloot1==""))):
$str0="Asset_Floot>=trim($textfloot0) and Asset_Floot<=trim($textfloot1)";
endif;
if ((($selectYear0=="年") or ($selectMonth0=="月") or ($selectDay0=="日")) And (($selectYear1=="年") or ($selectMonth1=="月") or ($selectDay1=="日"))):
{$str1="Asset_Floot>0";}
elseif ((($selectYear0!="年") or ($selectMonth0!="月") or ($selectDay0!="日")) And (($selectYear1=="年") or ($selectMonth1=="月") or ($selectDay1=="日"))):
{$str1="Asset_Upto>=trim('$selectYear0-$selectMonth0-$selectDay0')";}
elseif ((($selectYear0=="年") or ($selectMonth0=="月") or ($selectDay0=="日")) And (($selectYear1!="年") or ($selectMonth1!="月") or ($selectDay1!="日"))):
{$str1="Asset_Upto<=trim('$selectYear1-$selectMonth1-$selectDay1')";}
elseif ((($selectYear0!="年") or ($selectMonth0!="月") or ($selectDay0!="日")) And (($selectYear1!="年") or ($selectMonth1!="月") or ($selectDay1!="日"))):
{$str1="Asset_Upto>=trim('$selectYear0-$selectMonth0-$selectDay0') and Asset_Upto<=trim('$selectYear1-$selectMonth1-$selectDay1')";}
endif;}mysql_select_db($database_localhost, $localhost);
if((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form")):
{$query_Recordset1 = "SELECT * FROM assettb Where Asset_ID like trim('%$textnumber%') and Asset_Name like trim('%$textname%') and Asset_Sort like trim('%$selectsort%') and Asset_Kind like trim('%$selectkind%') and Asset_State like trim('%$selectstate%') and Asset_Province like trim('%$selectprovince%') and $str0 and $str1 and Asset_Bank like trim('%$textbank%') order by RIGHT(Asset_ID,8)";}
else:
{$query_Recordset1="SELECT * FROM assettb";}
endif;
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $localhost) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$queryString_Recordset1 = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
以上是包括13到70行的代码点击推荐的那一行:
点击推荐的那一行:
<td ><a href="assetsearch.php?AssetID=<?php echo $row_Recordset1['Asset_ID'];?>">推荐</a></td>请高手帮我看看