For verification goto http://web-sniffer.net/ and enter your URL.
HTTP Response Header
Name Value Delim
HTTP Status Code: HTTP/1.1 200 OK
Date: Tue, 28 Nov 2006 11:28:53 GMT CRLF
Server: Apache/2.2.3 (Win32) PHP/5.2.0 CRLF
X-Powered-By: PHP/5.2.0 CRLF
Content-Length: 5032 CRLF
Connection: close CRLF
Content-Type: text/html CRLF
As you can see were are recieving a Content-Type: of text/html which is incorrect and
<? header('Content-type: text/xml'); ?>
<rss version="2.0">
<channel>
<title>Code Cracking</title>
<description>
Which is basically your PHP header command as part of the output its not executing it because it needs to be <?php header('Content-type: text/xml'); ?> in order for PHP to treat it as PHP.
Compare this with a Valid RSS feed ( http://usertools.plus.net/
HTTP Status Code: HTTP/1.1 200 OK
Date: Tue, 28 Nov 2006 11:33:17 GMT CRLF
Server: Apache/2.0.52 (Debian GNU/Linux) PHP/4.3.10-13 CRLF
Last-Modified: Tue, 28 Nov 2006 10:00:06 GMT CRLF
ETag: "44ab4f-60a8-b6f6f580" CRLF
Accept-Ranges: bytes CRLF
Content-Length: 24744 CRLF
Connection: close CRLF
Content-Type: application/xml CRLF
You will see the type is application/xml.
If your header command is not working properly first time round try
<?php header('Content-type: application/xml'); ?>
Main Topics
Browse All Topics





by: rhickmottPosted on 2006-11-28 at 03:26:43ID: 18026867
If I execute dance.php from your server at the top of the source code im getting.
Gardner_SQ L.php');
<? header('Content-type: text/xml'); ?>
at the top of it. Its not being parsed because its not treating it as a PHP command and treating it as part of the output. As the default in PHP is HTML it will output HTML tags as its not receiving any request otherwise.
Change your PHP code to.
<?php
require_once('Connections/
header('Content-type: text/xml');
// REST OF PHP HERE
?>
The Header Command is a PHP FUNCTION and not a HTML request to the browser/ parser so should not be sent as part of the source code.
UNLESS you have short tags turned on in PHP.INI then
<? header('Content-type: text/xml'); ?>
Is not a valid PHP request so the browser is sending HTML headers and outputting that as plain text.