jasonc310771
11-26-2008, 02:31 AM
unable to execute PHP within an XML document
i have added the following line to my .htaccess file...
AddType application/x-httpd-php .xml
and this is my code in the xml file...
it shows the following error...
Parse error: syntax error, unexpected T_STRING on line 1
what could i be doing wrong that causes this error?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?php
$owner = "Daniel";
include("dbconfigfile.php");
$xmls = @mysql_query("SELECT * FROM `photo_album_xmls` WHERE `owner` = '" . $owner . "'") or die(mysql_error());
?>
<images>
<?php
while($rows=@mysql_fetch_array($xmls)){
?>
<pic>
<image>http://www.domain.com/photos/<?php echo($rows[url]);?></image>
<caption><?php echo($rows[desc]);?></caption>
</pic>
<?php
}
?>
</images>
i have added the following line to my .htaccess file...
AddType application/x-httpd-php .xml
and this is my code in the xml file...
it shows the following error...
Parse error: syntax error, unexpected T_STRING on line 1
what could i be doing wrong that causes this error?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?php
$owner = "Daniel";
include("dbconfigfile.php");
$xmls = @mysql_query("SELECT * FROM `photo_album_xmls` WHERE `owner` = '" . $owner . "'") or die(mysql_error());
?>
<images>
<?php
while($rows=@mysql_fetch_array($xmls)){
?>
<pic>
<image>http://www.domain.com/photos/<?php echo($rows[url]);?></image>
<caption><?php echo($rows[desc]);?></caption>
</pic>
<?php
}
?>
</images>