Jump to content

php in other file extensions


amitrus

Recommended Posts

I am currently trying to include php code in a .xml file.  The file would look something like this

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title></title>
<link></link>
<description></description>
<language>en-us</language>
<copyright></copyright>
<item>
<title></title>
<description> <?php echo $value; ?>  </description>
</item>
</channel>
</rss>


But I need to get my server to see the php in the .xml file. (The extension has to be .xml) How can I do this?  I've been fooling around with the .htaccess file, but still can't make my server see the php in a .xml file (I did manage, however, to make it see the php in a .html file by changing the .htaccess file.). 

Can anyone help me? 
Link to comment
Share on other sites

.htaccess is a part of Apache.
you don't need to access any apache configs. just add what ShogunWarrior posted in an .htaccess file and save that .htaccess file to the working directory.


but your XML file isn't valid to begin with.
you would have to surround your XML in CDATA tags
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.