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","$userna me", "$password" );
mysql_select_db ("secwhouse" );
?>
<head>
<title>Securi ty Warehouse Sample Concept</title>
</head>
<body>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<th scope="col"><ta ble width="750" border="0" cellspacing="0" cellpadding="0" >
<tr>
<th scope="col"><ob ject classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macrom edia.com/pub/
shockwave/cabs/flash/swflash.cab#ver sion=7,0,19,0" width="750" height="125">
<param name="movie" value="secbanne r2.swf" />
<param name="quality" value="high" />
<embed src="secbanner2 .swf" quality="high" pluginspage="ht tp://www.macromedia. com/go/getflashplayer" type="applicati on/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"><fo rm id="mnusrch" name="mnusrch" method="post" action="">
<table width="750" border="0" cellspacing="0" cellpadding="0" >
<tr>
<th scope="col"><in put type="text" name="textfield " /></th>
<th scope="col"><im g src="images/sec_01.gif" width="72" height="30" /></th>
<th scope="col"><im g src="images/sec_03.gif" width="359" height="30" /></th>
<th scope="col"><im g src="images/sec_04.gif" width="74" height="30" /></th>
<th scope="col"><im g 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"><im g src="images/menu_01.gif" width="91" height="14" /></th>
<th scope="col"><im g src="images/menu_02.gif" width="92" height="14" /></th>
<th scope="col"><im g src="images/menu_03.gif" width="104" height="14" /></th>
<th scope="col"><im g src="images/menu_04.gif" width="110" height="14" /></th>
<th scope="col"><im g src="images/menu_05.gif" width="91" height="14" /></th>
<th scope="col"><im g src="images/menu_06.gif" width="105" height="14" /></th>
<th scope="col"><im g src="images/menu_07.gif" width="157" height="14" /></th>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<th scope="col">&nb sp;</th>
</tr>
</table>
<?
$sql = "SELECT * FROM `prod` WHERE `prod`.`special ` = 'n'";
$counter=0;
$result =mysql_query($s ql);
while($rows=mys ql_fetch_array( $result))
{
$count=0;
while($count<>5 )
{
?>
<table border="0" cellspacing="0" cellpadding="0" id="main">
<tr>
<th scope="col"><ta ble 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">&nb sp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows['prod']; ?></th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows['price']; ?></th>
</tr>
</table></th>
<th scope="col">&nb sp;</th>
<th scope="col"><ta ble border="0" cellspacing="0" cellpadding="0" >
<tr>
<?
$rows=mysql_fet ch_array($resul t);
?>
<th scope="col"><? echo $rows['image']; ?></th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows['prod']; ?></th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row"><? echo $rows['price']; ?></th>
</tr>
</table></th>
<th scope="col">&nb sp;</th>
<th scope="col"><ta ble border="0" cellpadding="0" cellspacing="0" id="right1">
<tr>
<th scope="col">&nb sp;</th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
<tr>
<th scope="row">&nb sp;</th>
</tr>
</table></th><? $count=5 ?>
</tr>
</table><? } }?>
<br />
<p> </p>
<p><br />
</p>
<p> </p>
<p> </p>
<p> </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