Jump to content

Include PHP code inside XML


FMR

Recommended Posts

Hello everyone,

 

I'm trying to include this PHP code inside of a .xml:

<?php
$parent = basename(dirname($_SERVER['PHP_SELF']));
echo $parent;
?>

 

The code doesn't seem to be recognized at all.

 

I tried to create a .htaccess file and dropped it in the same folder as the .xml:

 

AddHandler x-httpd-php .xml
AddHandler php-script .php .xml
AddHandler php5-script .php .xml
AddType application/x-httpd-php .xml
AddType application/x-httpd-php .xml

I was trying the parse .xml as .php. I changed the header of the xml for:

 

<?php
header("Content-Type: text/xml;charset=utf-8");
?>

 

and still no luck.

 

I attached the xml file with this post.

 

I must say. I'm out of ideas for something I am sure is possible.

 

If someone has any ideas at all it would be really appreciated.

 

Thank you in advance!

 

FMR

 

 

products.xml

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...