# PHP won't allow header change :'(

**URL:** <https://forum.kirupa.com/t/php-wont-allow-header-change/49624>\
**Category:** programming\
**Created:** [April 24, 2004, 9:28pm UTC](https://forum.kirupa.com/t/php-wont-allow-header-change/49624 "2004-04-24T21:28:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [April 24, 2004, 9:28pm UTC](https://forum.kirupa.com/t/php-wont-allow-header-change/49624/1 "2004-04-24T21:28:40Z")

</div>

Hello,

I just finished (well, almost finished) the [Output mySQL data as XML with PHP](http://kirupa.com/web/mysql_xml_php.htm) tutorial and when I tested it, it did not sucede in doing it’s job. I also have another question but I’ll get to that after this. It gave me an error that looked similar to this:

**Warning** : Cannot modify header information - headers already sent by (output started at \*\*\*\*\parse\_mysql\_to\_xml.php:1) in \*\*\*\ ***\parse\_mysql\_to\_xml.php** on line \*\*3

\*\*and I thing I have apache or php setup incorrectly because I don’t know any other way to fix that (does that sentence make any sense). Does anybody know how to fix that error.

Ok, now for my second question. I was trying to have the script export the final xml to a seperate file, which has an xml extension (unless of course I could give the php script and xml extension). I think I would use some type of fopen like this:  
$f=fopen(“welcome.txt”,“r”);  
[left]but I don’t know how to then set the text inside to be what I want.  
[/left]

Cheers,  
Jeff
