警告:无法修改标头信息 [英] Warning: Cannot modify header information

查看:80
本文介绍了警告:无法修改标头信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法更改标题以显示数据库中的图像。它给了我这个错误:


警告:无法修改标题信息 - 已经发送的标题(输出从/ home / content / d / f / m / dfmcons / html开始/secwhouse/index.php:18)在第71行的/home/content/d/f/m/dfmcons/html/secwhouse/index.php


这是代码:

[php]

< ;?

mysql_connect(" $ host"," $ username"," $ password") ;

mysql_select_db(" secwhouse");

?>

< head>

< title> ;安全仓库样本概念< / title>

< / head>

< body>

< table width =" 750" ;边界=" 0" CELLSPACING = QUOT; 0" CELLPADDING = QUOT; 0" align =" center">

< tr>

< th scope =" col">< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0"

< tr>

< th scope =" col">< object classid =" clsid:D27CDB6E- AE6D-11CF-96B8-444553540000" codebase =" http://download.macromedia.com/pub/

shockwave / cabs / flash / swflash.cab#version = 7,0,19,0"宽度= QUOT; 750" height =" 125">

< param name =" movie"值= QUOT; secbanner2.swf" />

< param name =" quality"值=&是高电平QUOT; />

< embed src =" secbanner2.swf"质量=&是高电平QUOT; PLUGINSPAGE = QUOT; HTTP://www.macromedia.com/go/getflashplayer"类型= QUOT;应用程序/ x-冲击波闪光"宽度= QUOT; 750" height =" 125">< / embed>

< / object>< / th>

< / tr>

< / table>

< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< form id =" mnusrch"名称= QUOT; mnusrch"方法= QUOT;交" action ="">

< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< input type =" text"名称= QUOT;文本框" />< / th>

< th scope =" col">< img src =" images / sec_01.gif"宽度= QUOT; 72"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_03.gif"宽度= QUOT; 359"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_04.gif"宽度= QUOT; 74"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_05.gif"宽度= QUOT; 98"高度= QUOT; 30英寸; />< / th>

< / tr>

< / table>

< / form>

< / th>

< / tr>

< / table>

< table width =" ; 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< img src =" images / menu_01。 GIF"宽度= QUOT; 91"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_02.gif"宽度= QUOT; 92"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_03.gif"宽度= QUOT; 104"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_04.gif"宽度= QUOT; 110"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_05.gif"宽度= QUOT; 91"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_06.gif"宽度= QUOT; 105"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_07.gif"宽度= QUOT; 157"高度= QUOT; 14'; />< / th>

< / tr>

< / table>

< table border =" 0" ; CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">& nbsp;< / th>

< / tr>

< / table>

< ;?

$ sql =" SELECT * FROM`prod` WHERE`prod` .special` =''n''" ;;

$ counter = 0;

$ result = mysql_query($ sql) ;

while($ rows = mysql_fetch_array($ result))

{

$ count = 0;

while($ count<> 5)

{

?>

< table border =" 0" CELLSPACING = QUOT; 0" CELLPADDING = QUOT; 0" id =" main">

< tr>

< th scope =" col">< table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0" id =" left1">

< tr>

< th scope =" col"><? header(" Content-type:image / jpeg"); echo $ rows [''image'']; ?>< / th>

< / tr>

< tr>

< th scope =" row" >& nbsp;< / th>

< / tr>

< tr>

< th scope =" ;排">< ;? echo $ rows [''prod'']; ?>< / th>

< / tr>

< tr>

< th scope =" row" >& nbsp;< / th>

< / tr>

< tr>

< th scope =" ;排">< ;? echo $ rows [''price'']; ?>< / th>

< / tr>

< / table>< / th>

< th scope =" col">& nbsp;< / th>

< th scope =" col">< table border =" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< ;?

$ rows = mysql_fetch_array($ result);

?>

< th scope =" col"><? echo $ rows [''image'']; ?>< / th>

< / tr>

< tr>

< th scope =" row" >& nbsp;< / th>

< / tr>

< tr>

< th scope =" ;排">< ;? echo $ rows [''prod'']; ?>< / th>

< / tr>

< tr>

< th scope =" row" >& nbsp;< / th>

< / tr>

< tr>

< th scope =" ;排">< ;? echo $ rows [''price'']; ?>< / th>

< / tr>

< / table>< / th>

< th scope =" col">& nbsp;< / th>

< th scope =" col">< table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0" id =" right1">

< tr>

< th scope =" col">& nbsp;< / th>

< / tr>

< tr>

< th scope =" row">& nbsp;< / th> ;

< / tr>

< tr>

< th scope =" row">& nbsp;< ; / th>

< / tr>

< tr>

< th scope =" row">& nbsp;< / th>

< / tr>

< tr>

< th scope =" row"> ;& nbsp;< / th>

< / tr>

< / table>< / th><? $ count = 5?>

< / tr>

< / table><? }>

< br />

< p>& nbsp;< / p>

< p>< br />

< / p>

< p>& nbsp;< / p>

< p>& nbsp;< / p>

< p>& nbsp;< / p>< / th>

< / tr>

< / table>

< / body>

< / html>

[ / php]我遗漏了连接细节,因为密码是可见的

这不是你唯一遗漏的东西。您必须将所有代码括在相应的代码标记中。阅读发布指南。 - 主持人

解决方案

host","


username","


密码");

mysql_select_db(" secwhouse");

?>

< head>

< title> ;安全仓库样本概念< / title>

< / head>

< body>

< table width =" 750" ;边界=" 0" CELLSPACING = QUOT; 0" CELLPADDING = QUOT; 0" align =" center">

< tr>

< th scope =" col">< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0"

< tr>

< th scope =" col">< object classid =" clsid:D27CDB6E- AE6D-11CF-96B8-444553540000" codebase =" http://download.macromedia.com/pub/

shockwave / cabs / flash / swflash.cab#version = 7,0,19,0"宽度= QUOT; 750" height =" 125">

< param name =" movie"值= QUOT; secbanner2.swf" />

< param name =" quality"值=&是高电平QUOT; />

< embed src =" secbanner2.swf"质量=&是高电平QUOT; PLUGINSPAGE = QUOT; HTTP://www.macromedia.com/go/getflashplayer"类型= QUOT;应用程序/ x-冲击波闪光"宽度= QUOT; 750" height =" 125">< / embed>

< / object>< / th>

< / tr>

< / table>

< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< form id =" mnusrch"名称= QUOT; mnusrch"方法= QUOT;交" action ="">

< table width =" 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< input type =" text"名称= QUOT;文本框" />< / th>

< th scope =" col">< img src =" images / sec_01.gif"宽度= QUOT; 72"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_03.gif"宽度= QUOT; 359"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_04.gif"宽度= QUOT; 74"高度= QUOT; 30英寸; />< / th>

< th scope =" col">< img src =" images / sec_05.gif"宽度= QUOT; 98"高度= QUOT; 30英寸; />< / th>

< / tr>

< / table>

< / form>

< / th>

< / tr>

< / table>

< table width =" ; 750"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">< img src =" images / menu_01。 GIF"宽度= QUOT; 91"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_02.gif"宽度= QUOT; 92"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_03.gif"宽度= QUOT; 104"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_04.gif"宽度= QUOT; 110"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_05.gif"宽度= QUOT; 91"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_06.gif"宽度= QUOT; 105"高度= QUOT; 14'; />< / th>

< th scope =" col">< img src =" images / menu_07.gif"宽度= QUOT; 157"高度= QUOT; 14'; />< / th>

< / tr>

< / table>

< table border =" 0" ; CELLSPACING = QUOT; 0" cellpadding =" 0">

< tr>

< th scope =" col">& nbsp;< / th>

< / tr>

< / table>

< ;?


Hi, I cant change the header to display images from a database. It''s giving me this error :

Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/f/m/dfmcons/html/secwhouse/index.php:18) in /home/content/d/f/m/dfmcons/html/secwhouse/index.php on line 71

Here is the code :
[php]
<?
mysql_connect("$host","$username", "$password");
mysql_select_db("secwhouse");
?>
<head>
<title>Security Warehouse Sample Concept</title>
</head>
<body>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<th scope="col"><table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="750" height="125">
<param name="movie" value="secbanner2.swf" />
<param name="quality" value="high" />
<embed src="secbanner2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="125"></embed>
</object></th>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><form id="mnusrch" name="mnusrch" method="post" action="">
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><input type="text" name="textfield" /></th>
<th scope="col"><img src="images/sec_01.gif" width="72" height="30" /></th>
<th scope="col"><img src="images/sec_03.gif" width="359" height="30" /></th>
<th scope="col"><img src="images/sec_04.gif" width="74" height="30" /></th>
<th scope="col"><img src="images/sec_05.gif" width="98" height="30" /></th>
</tr>
</table>
</form>
</th>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><img src="images/menu_01.gif" width="91" height="14" /></th>
<th scope="col"><img src="images/menu_02.gif" width="92" height="14" /></th>
<th scope="col"><img src="images/menu_03.gif" width="104" height="14" /></th>
<th scope="col"><img src="images/menu_04.gif" width="110" height="14" /></th>
<th scope="col"><img src="images/menu_05.gif" width="91" height="14" /></th>
<th scope="col"><img src="images/menu_06.gif" width="105" height="14" /></th>
<th scope="col"><img src="images/menu_07.gif" width="157" height="14" /></th>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">&nbsp;</th>
</tr>
</table>
<?
$sql = "SELECT * FROM `prod` WHERE `prod`.`special` = ''n''";
$counter=0;
$result =mysql_query($sql);
while($rows=mysql_fetch_array($result))
{
$count=0;
while($count<>5)
{
?>
<table border="0" cellspacing="0" cellpadding="0" id="main">
<tr>
<th scope="col"><table border="0" cellpadding="0" cellspacing="0" id="left1">
<tr>
<th scope="col"><? header("Content-type: image/jpeg");echo $rows[''image'']; ?></th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows[''prod'']; ?></th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows[''price'']; ?></th>
</tr>
</table></th>
<th scope="col">&nbsp;</th>
<th scope="col"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<?
$rows=mysql_fetch_array($result);
?>
<th scope="col"><? echo $rows[''image'']; ?></th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows[''prod'']; ?></th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows[''price'']; ?></th>
</tr>
</table></th>
<th scope="col">&nbsp;</th>
<th scope="col"><table border="0" cellpadding="0" cellspacing="0" id="right1">
<tr>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
</tr>
</table></th><? $count=5 ?>
</tr>
</table><? } }?>
<br />
<p>&nbsp;</p>
<p><br />
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></th>
</tr>
</table>
</body>
</html>
[/php]I left out the connection details, cos the password is visible

That is not the only thing you left out. You must enclose all code within the appropriate code tags. Read the Posting Guidelines. - moderator

解决方案

host","


username", "


password");
mysql_select_db("secwhouse");
?>
<head>
<title>Security Warehouse Sample Concept</title>
</head>
<body>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<th scope="col"><table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="750" height="125">
<param name="movie" value="secbanner2.swf" />
<param name="quality" value="high" />
<embed src="secbanner2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="125"></embed>
</object></th>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><form id="mnusrch" name="mnusrch" method="post" action="">
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><input type="text" name="textfield" /></th>
<th scope="col"><img src="images/sec_01.gif" width="72" height="30" /></th>
<th scope="col"><img src="images/sec_03.gif" width="359" height="30" /></th>
<th scope="col"><img src="images/sec_04.gif" width="74" height="30" /></th>
<th scope="col"><img src="images/sec_05.gif" width="98" height="30" /></th>
</tr>
</table>
</form>
</th>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><img src="images/menu_01.gif" width="91" height="14" /></th>
<th scope="col"><img src="images/menu_02.gif" width="92" height="14" /></th>
<th scope="col"><img src="images/menu_03.gif" width="104" height="14" /></th>
<th scope="col"><img src="images/menu_04.gif" width="110" height="14" /></th>
<th scope="col"><img src="images/menu_05.gif" width="91" height="14" /></th>
<th scope="col"><img src="images/menu_06.gif" width="105" height="14" /></th>
<th scope="col"><img src="images/menu_07.gif" width="157" height="14" /></th>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">&nbsp;</th>
</tr>
</table>
<?


这篇关于警告:无法修改标头信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆