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

Sending headers in PHP under Godaddy linux hosting

Hi,

I have the following issue when i upload my files to my hosting. I
cannot send the following headers:

<?php
header('Content-Type: text/xml');
header('Pragma: no-cache');

When I execute the code, I get:

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 1

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 2

Notice that this code works perfectly on my local server because I
have added PHP_FLAG output_buffering on in my .htaccess file.

If I do this on my remote server, nothing happens and i continue to
have those 2 warnings. I also tried to use this command in the php.ini
file and nothing happened.

Can someone help me on that matter? I would really appreciate.

Jul 13 '08 #1
3 2193
..oO(Webrickco)
>I have the following issue when i upload my files to my hosting. I
cannot send the following headers:

<?php
header('Content-Type: text/xml');
header('Pragma: no-cache');

When I execute the code, I get:

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 1

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 2

Notice that this code works perfectly on my local server because I
have added PHP_FLAG output_buffering on in my .htaccess file.
You should _disable_ output buffering and fix your code instead.
Check what causes the output and rethink the code structure.

Micha
Jul 13 '08 #2
Message-ID:
<c0**********************************@m36g2000hse. googlegroups.comfrom
Webrickco contained the following:
>Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 1
What's on line 1? Is it perhaps a blank line?

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
http://slipperyhill.co.uk
100110001101101111001011100111010101101011
Jul 13 '08 #3
Message-ID:
<4e**********************************@m36g2000hse. googlegroups.comfrom
Webrickco contained the following:
>I don't think I'm am sending any blank line, or any output before my
first header, otherwise, it wouldn't be working on my local server
Well you are obviously outputting headers! If not a blank line what
about an error notice before you send your headers?

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk
Jul 13 '08 #4

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

Similar topics

2
by: Peter Gaunt | last post by:
I'm in the process of moving my site from one server to another (my old hosting company appears to have gone bust). On the old host and on my local Mac OS X machine I can send HTTP/1.1 response...
2
by: Dale | last post by:
I'm (trying) to help a friend setup a MySQL db and use some simple scripts on a site hosted with GoDaddy. I note that GoDaddy appears to use Microsoft. I have done this: $connection =...
4
by: z f | last post by:
Hi, i'm sending mail from the aspx page on the server. it is running on hosting, so i configure the System.Web.Mail.SmtpMail.SmtpServer property to my mail server. but problem is that sender...
1
by: warfque | last post by:
The program I have does a Whois search but can not use port 43 at Godaddy hosting. http://www.netbonded.com/whois/samswhois.inc.php. This is the code where the error occurs. function...
1
by: David Horowitz | last post by:
Hi folks, Just set up Dedicated Server Hosting with GoDaddy. I put a very simple ASP page in the home web directory and try to load it and get a very generic error. A simple HTML file works...
1
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the...
3
by: Liam | last post by:
We currently have a dedicated server with Rackspace, and they've been been great for 5 years now. But they are SO expensive! We're looking into GoDaddy's dedicated hosting, and they're 1/3 to...
8
by: Marty | last post by:
I'm having issues sending an email to an "@page.nextel.com" email address. I can send to any other email address fine, but when I try the page.nextel.com it gives me this error: ...
1
vikysaran
by: vikysaran | last post by:
Hello, i'm getting few error on my AJAX enabled application when i'm uploading it to GoDaddy server. Its firsttime I'm using godaddy hosting. can anybody send me web.config file that's working on...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.