html - How can I add php to an xml file using .htaccess and make it work? -


i have in xml file

addtype application/x-httpd-php .xml 

which using inside xml file can print things inside database.
<?xml?> apparently php , returns parse error.

how can fix this?

try using

addhandler application/x-httpd-php5 .php .xml 

also check short_open_tag , make sure it's in php.ini file , not using it

short_open_tag = off 

also, can write/generate xml .php file using (if option)

<?php     header('content-type: text/xml');     echo '<?xml version="1.0" encoding="utf-8"?>'; ?> <item>     <title><?php echo "something"; ?></title> </item> <?php     // more php code ?> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -