You are here: SimpleXML and load php file (Content-type: text/xml) « PHP Programming Language « IT news, forums, messages
SimpleXML and load php file (Content-type: text/xml)

Posted by whisher on 01/14/07 18:43

Hi.
I'm taking my first steps with xml and SimpleXML functions.
xml.php
(It could be made dynamically with a mysql result
I post this snippet for example )

PHP Code xml.php:

<?php
$xmlstr = "<?xml version=\"1.0\" standalone=\"yes\"?>";
$xmlstr .= "<movies>\n<movie>Behind the Parser</movie>\n</movies>\n";
header('Content-type: text/xml; charset=utf-8');
echo $xmlstr;
?>

PHP Code loadXml.php:

I've got this nasty error :
Warning: xml.php:2: parser error : Start tag expected, '<' not found in
c:\xxx\www\xml\example\mioplot.php on line 3

Warning: $xmlstr = ""; in c:\xxx\www\xml\example\loadXml.php on line 3

Warning: ^ in c:\xxx\www\xml\example\loadXml.php on line 3
bool(false)

I've got the same error in my web site .


xml.php is a valid xml file, isn't it ?
Therefore I'm wondering why the snippet
doesn't work ?
Thanks in advance.

Bye.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация