Re: [PHP] PHP within XML?

2011-08-25 Thread Ken Robinson

Quoting Ron Piggott :



I am trying to figure out if it is possible to have PHP work within  
an XML document.


The application is tracking RSS subscribers IP addresses within the database.

I have wrote functions so the PHP code required is below is minimal,  
after the XML declaration line.


Prior to posting this question I tried to have the PHP at the very  
start, but that doesn’t work, the declaration line needs to be first.


Right now the PHP is displayed as a comment.


In order for your PHP code to be processed the file should be named  
with a .php extension. Since you're writing XML code, you need to send  
an XML header type first:

' . "\n";
?>
Rest of your XML content.


This should work.

Ken


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP within XML?

2011-08-25 Thread John Black

On 25.08.2011 16:06, Ron Piggott wrote:

I am trying to figure out if it is possible to have PHP work within an XML 
document.
Right now the PHP is displayed as a comment.
Thoughts anyone?
Ron


How are you executing the XML file? By calling it with your browser?
You may need to tell your webserver that you want to treat your xml file 
as a PHP document.


You can use .htaccess for this and add something like this:

 ForceType application/x-httpd-php


Hope this helps.
--
John



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP within XML?

2011-08-25 Thread Ron Piggott

I am trying to figure out if it is possible to have PHP work within an XML 
document.

The application is tracking RSS subscribers IP addresses within the database.

I have wrote functions so the PHP code required is below is minimal, after the 
XML declaration line.  

Prior to posting this question I tried to have the PHP at the very start, but 
that doesn’t work, the declaration line needs to be first.

Right now the PHP is displayed as a comment.

Thoughts anyone?

Ron

===




RSS content starts here 

===

Ron

The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info