xml parsing error: syntax error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rrlangly
Forum Newbie
Posts: 1
Joined: Thu Nov 14, 2013 4:36 pm

xml parsing error: syntax error

Post by rrlangly »

I'm new w/ php and have the following file in the directory root of apache and php installed. I trying to learn REST and do a POST. So I'm beginning w/ a simple file, but its causing me errors already.

my file ...

Code: Select all

<?php
header("Content-Type: text/xml");

$method = $_SERVER['REQUEST_METHOD'];
$uri = $_SERVER['REQUEST_URI'];

print "method = $method\n";
print "uri = $uri\n";

?>
my error ...
[text]
XML Parsing Error: syntax error
Location: http://192.168.100.23/tests/tst.php
Line Number 1, Column 1:

method = GET
^
[/text]

Any idea whats going on?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: xml parsing error: syntax error

Post by requinix »

That's not valid XML you're outputting there. Not by a long shot.
Post Reply