Jump to content

Help with Cannot modify header information


alexguz79

Recommended Posts

Hey everybody... i have this HUGE question.... maybe you guys can help me

 

i'm having this 'Cannot modify header information' problem:

 

--------------------------------------------------------------------

Cannot modify header information - headers already sent by (output started at /home/mytrende/public_html/index_toptrends.php:7) in /home/mytrende/public_html/img_tech.php on line 8

--------------------------------------------------------------------

 

somewhere i read that you have to fix the first file on the line... not the second.... but when i check the file 'index_toptrends.php' everything looks ok to me... here is the code of that file:

 

--------------------------------------------------------------------

<title>Trend*e :: Top Trends</title>

</head>

<body>

<table width="1000" border="0" cellpadding="0" cellspacing="0" align="center">

<tr>

<td width="1000" height="19" valign="top">

<?php define('IN_SCRIPT','true');

$script_root = './';

include($script_root . 'head.php'); ?>

</td>

</tr>

</table>

<table width="1000" border="0" cellpadding="0" cellspacing="0" align="center">

<tr>

<td width="1000" height="19" valign="top">

<?

define('IN_SCRIPT', 'true');

$script_root = './';

include($script_root . 'toptrends.php'); ?>

</td>

</tr>

</table>

</body>

</html>

--------------------------------------------------------------------

 

If you can help me.. plese... i.ve been reading about the problem but still can't fix it

Link to comment
Share on other sites

you are using <?php session_start()?> on another page and including it to a page that has html before session_start....

 

for the solution you need to use the ob_start() and ob_flush() at the end

 

example....

This needs to be added to all included pages.php as your trying

to use header info while useing html ..

 

use this code format within head.php and toptrends.php

<?php
ob_start()
session_start();

//bla bla bla php code on toptrends.php and head.php 

ob_flush();
?>

Link to comment
Share on other sites

ok... thanx.... here is how i fix it.... found the answer on this forum

 

forgot about the index_toptrends.... and forgot abot making changes to img_tech...

 

on the page i wanted the image to display i just changed the code for a

 

<img src="img_tech.php">

 

THAT FIX IT....

thanxs again

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.