Re: Generating XML

From: Date: Wed, 25 Apr 2001 16:54:02 +0000
Subject: Re: Generating XML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50321@lists.php.net to get a copy of this message
}I'm trying to write a script that generates XML dynamically and is }viewable in a browser (IE). Even though I send a header saying }"Content-type: text/xml\n", PHP still puts in a Content-type of }text/html before that. How can I write the script so that this doesn't }happen? } }Here's the script: } }<?php } }header("Content-type: text/xml\n"); } First, ditch the \n in the above header... PHP will add the newline for you.. =) Second, make sure that the <?php is the very first thing in your file. There should not be any spaces, newlines or any other characters before the <?php ... the < character should be the first character in the file.. =) -- Jeff Carnahan - jcarnahan@networq.com

« previous php.general (#50321) next »