/    Sign up×
Community /Pin to ProfileBookmark

How to enable PHP in XML

Hi PHP masters,

I can’t run php code in XML file.

Where do I have to change the setting ?

Thanks extremely much.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyMar 28.2006 — You have a couple of options depending on what your permissions are.

1) Name the file with a .php extention so that it gets processed, but make sure to include a header information to specify that it is a XML file for the browser.

2) Modify your php setup to parse .xml files aswell as .php files - this will mean that every xml file will be parsed and therefore using more of the servers resources - even if the xml file has no php in it.

Just get back to us on the option you would prefer for more information.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYMar 28.2006 — if it's only for a few filesm i'd suggest number one, i'm not sure, but couldn't the xml "<?" tags drive the PHP engine crazy?
Copy linkTweet thisAlerts:
@bathurst_guyMar 28.2006 — well you can do simple runarounds like
[code=php]<?
echo "<";
?>
? xml... [/code]
if that makes sense
Copy linkTweet thisAlerts:
@bokehMar 28.2006 — Or switch off short tags.
×

Success!

Help @iota spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...