Read page URL in XML? Or use PHP within an XML file

pritamcharan

New Member
I have a flash element (I know, but please don't) with a settings.xml file.One of the values in the XML file depends on the URL, so rather than having multiple instances of the flash folder, I want to do the following:\[code\]value="http://stackoverflow.com/questions/11143640/<?php $rest = substr(<?php echo curPageURL(); ?>, -2, -1) ?>"\[/code\]I tried that in vain, but as you probably already knew, that won't work.So I either need a way to write that in XML, or to allow that line of PHP within the XML file.\[code\]function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $pageURL. = "s"; } $pageURL. = "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL. = $ _SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL. = $ _SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL;}\[/code\]
 
Back
Top