473,383 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Error:Cannot modify header information - headers already sent

254 100+
Hi
I am working on gd library with PHP to create graphs which is displaying correctly. But I want to display some information about this graph as text which will not be part of this graph means image or I want to print this graph in a table. but while doing this I got this error

Cannot modify header information- header already sent.

So how can I do this. If code is needed I will provide.
Feb 6 '08 #1
5 3430
Markus
6,050 Expert 4TB
Hi
I am working on gd library with PHP to create graphs which is displaying correctly. But I want to display some information about this graph as text which will not be part of this graph means image or I want to print this graph in a table. but while doing this I got this error

Cannot modify header information- header already sent.

So how can I do this. If code is needed I will provide.
It means you've already had output from the script, so the headers cannot be sent.

And yes: code is needed.
Feb 6 '08 #2
mukeshrasm
254 100+
It means you've already had output from the script, so the headers cannot be sent.

And yes: code is needed.
Ok I am giving you the code which I am using and I want to display this image inside a table

Expand|Select|Wrap|Line Numbers
  1. //php code
  2.  
  3. $image=imagecreate(200,200);
  4. imagecolorallocate($image,150,200,30)
  5. header("Content-Type image/png");
  6. imagepng($image);
  7.  
I want this image should come in the table.
Feb 6 '08 #3
pks83
10
Hello

I am also facing the same problem this the error message i am getting.

Warning: Cannot modify header information - headers already sent by (output started at header.php:96) in my.class.php on line 1198


What is happening over here is that i when i am trying to download an attached file i am passing the additional header information which is conflicting with the header info which has already being sent before.

Please help on how can i send this header info along with the one passed already.

I checked for all the whitespaces in the header file etc and removed it.
Feb 6 '08 #4
Markus
6,050 Expert 4TB
Ok I am giving you the code which I am using and I want to display this image inside a table

Expand|Select|Wrap|Line Numbers
  1. //php code
  2.  
  3. $image=imagecreate(200,200);
  4. imagecolorallocate($image,150,200,30)
  5. header("Content-Type image/png");
  6. imagepng($image);
  7.  
I want this image should come in the table.
Can you move lines 3 & 4 to after the header?

(i'm not experienced with headers...)
Feb 6 '08 #5
mukeshrasm
254 100+
Hello

I am also facing the same problem this the error message i am getting.

Warning: Cannot modify header information - headers already sent by (output started at header.php:96) in my.class.php on line 1198


What is happening over here is that i when i am trying to download an attached file i am passing the additional header information which is conflicting with the header info which has already being sent before.

Please help on how can i send this header info along with the one passed already.

I checked for all the whitespaces in the header file etc and removed it.
Might be you will get your solution at this url:

http://in2.php.net/header

go through this url carefully.
Feb 7 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sorisio, Chris | last post by:
Ladies and gentlemen, I've imported some data from a MySQL database into a Python dictionary. I'm attempting to tidy up the date fields, but I'm receiving a 'mx.DateTime.Error: cannot convert...
9
by: Eric Lilja | last post by:
Hello, I'm a novice C++ programmer and now I have the task of converting a number of C++ functions to C. Some of the functions I'm converting takes a parameter of type reference-to-std::string...
0
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
1
by: Vycka | last post by:
Hello, There is a enterprise web application that is based on asp.net technologies and works on Microsoft IIS. The total number of users is 850. When the load of system gets very high, the...
5
by: Dominiek | last post by:
Hi, I have a strange problem. during the developement of my program, while progressively writing more and more code, the callstack of my program gets deeper and deeper (7 levels). Then, all...
0
by: mcskf | last post by:
Hi, We develop a web based app in VB.Net 1.1. We use an conrol class for holding user's variables. The control process is created when the session created. In the control class we have many...
2
by: Elliott | last post by:
Hello Everyone, I have a function in a header (KeyDialog.h) as such: void setKey(Key&); The function implementation is as such (KeyDialog.cpp): void KeyDialog::setKey(Key& k1) {
2
by: srilathaapi | last post by:
Hi All, I am getting the error cannot redeclare the class some xxx in file xxx.php. bcz i m including xxx.php in 3 diffrent functions in the same file to invoke the 3 differnet functions in the...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.