473,385 Members | 1,587 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,385 software developers and data experts.

Problem with PHP output

Hello,
I have an html menu that I renamed menu.php. I then have a download
program which uses an index.php file. I did the standard <?php
include("menu.php"); ?command and I see the menu. However, it messes
up the php index file. When I go to download a file it just opens the
file on the screen for some reason rather than showing a popup window
asking where to put the downloaded file. I then tried to just add the
html code into the index.php file and that didn't work either. When I
take out the <?php include("menu.php"); ?command the script works
perfect. I then tried another download script and it puts the menu on
the screen, but the php file that runs after the menu is not centered
and looks bad. Does anyone know what the problem could be? Is it
something with my .htaccess file?
Any help would be appreciated.
Jul 23 '07 #1
10 1446
On Sun, 22 Jul 2007 18:25:31 -0700, John
<Jo*********@nnnnnnnnn.nowherewrote:

I'm also getting this.
Cannot modify header information - headers already sent by (output
Jul 23 '07 #2
John wrote:
On Sun, 22 Jul 2007 18:25:31 -0700, John
<Jo*********@nnnnnnnnn.nowherewrote:

I'm also getting this.
Cannot modify header information - headers already sent by (output
Sorry, my crystal ball is broken. Without seeing the code it would be
impossible to determine which of the thousands of possible errors you
could be making.

But you might try searching on the error message - it could be very
illuminating. And if you still can't figure it out, try posting the
failing code here.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 23 '07 #3
Jerry Stuckle wrote:
John wrote:
>On Sun, 22 Jul 2007 18:25:31 -0700, John
<Jo*********@nnnnnnnnn.nowherewrote:

I'm also getting this.
Cannot modify header information - headers already sent by (output

Sorry, my crystal ball is broken. Without seeing the code it would be
impossible to determine which of the thousands of possible errors you
could be making.

But you might try searching on the error message - it could be very
illuminating. And if you still can't figure it out, try posting the
failing code here.
I used to get that one a LOT. For me - it was almost always because I
was trying to set a cookie or otherwise add an HTTP header AFTER I had
already sent the output buffer to the client.
Jul 23 '07 #4
>I used to get that one a LOT. For me - it was almost always because I
was trying to set a cookie or otherwise add an HTTP header AFTER I had
already sent the output buffer to the client.


Here is the error.

PHP Warning: Cannot modify header information - headers already sent
by (output started at /home/etc.
How do I fix this?

Jul 23 '07 #5
..oO(John)
>Here is the error.

PHP Warning: Cannot modify header information - headers already sent
by (output started at /home/etc.
How do I fix this?
This issue comes up often enough and is answered often enough! You
should learn how to use Google Groups to search through the archives.

In short: You're sending something to the browser already (could be a
space, a newline, something like that), so no further headers can be
sent. The error message usually tells you where the output started.

Micha
Jul 23 '07 #6
>In short: You're sending something to the browser already (could be a
space, a newline, something like that), so no further headers can be
sent. The error message usually tells you where the output started.

Micha

Can you have this <?php include("menu.php"); ?>

and then start another php file <?php

whatever code

?>
Or how is the best way to call the menu.php file inside of the php
file that I want to run?

Jul 23 '07 #7
..oO(John)
>>In short: You're sending something to the browser already (could be a
space, a newline, something like that), so no further headers can be
sent. The error message usually tells you where the output started.

Can you have this <?php include("menu.php"); ?>

and then start another php file <?php

whatever code

?>
Whatever you like. You just can't output anything in the script that
starts the file download.

Micha
Jul 23 '07 #8
Message-ID: <6k********************************@4ax.comfrom John
contained the following:
>I have an html menu that I renamed menu.php. I then have a download
program which uses an index.php file. I did the standard <?php
include("menu.php"); ?command and I see the menu. However, it messes
up the php index file. When I go to download a file it just opens the
file on the screen for some reason rather than showing a popup window
asking where to put the downloaded file.
Your download program worKs by sending out headers which tell the
browser what to expect. Generating any other output before these
headers are sent will cause PHP to send other headers which you don't
see and then html output. Once this has started you cannot then send
headers again and hence the error message.

In short, you can't include the me
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 23 '07 #9
Message-ID: <v1********************************@4ax.comfrom Geoff
Berrow contained the following:
>In short, you can't include the me
nu.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 23 '07 #10
>In short, you can't include the menu

Thanks for the reply and detailed answer.

That will help me move forward.

Jul 23 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: geoffblanduk_nospam | last post by:
Given a set of intervals {i1, i2, i3, ...} a list is produced; the base items (0) are placed one at a time into the stream and after the ix one a interval item (1, 2, 3, etc) of the correct type is...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
0
by: michael | last post by:
Hi. I have a problem using the CollectioEditor. In my custom control I have a public property that returns ItemList. ItemList is inherited from CollectionBase and contains very simple items...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
1
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return...
4
by: leslie_tighe | last post by:
Hello, I have a webservice running on a J2EE server created with Axis 1.2.. I have a client that I am building in .net that needs to consume this webserivce and am having a bit of trouble. I have...
0
by: ryan | last post by:
I've been tasked with consuming a Perl web service that was written by a person in a different department of my company. The problem is it's the guy's first attempt at web services and he doesn't...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
2
by: Thelonious Monk | last post by:
I have a problem where some data is being eliminated. The problem is that the data contains signed numeric fields (the low-order byte of a negative number uses the first 4 bits as a sign and...
13
by: jamesonang | last post by:
Supposed unsigned int(32 bits) is the largest number that computer can represent with a single variable. Now, i have a big integer ( less than 64 bit, but great than 32 bit) . i represent it by...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.