Jump to content

Dynamically generate XML


ojsimon

Recommended Posts

Hi

I am trying to create an xml file like this

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="hello world example" /> 
  <Content type="html">
     <![CDATA[ 
       Hello, world!
     ]]>
  </Content> 
</Module>

 

Insteas of the

    <![CDATA[ 
       Hello, world!
     ]]>

 

I would like to insert dynamic code. AS i am trying to allow my users to embed dynamic widgets to igoogle.

 

How can i replace this hello world code with dynamically placed code.

 

Any suggestions

Link to comment
https://forums.phpfreaks.com/topic/133765-dynamically-generate-xml/
Share on other sites

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="hello world example" />
  <Content type="html">
     <![CDATA[
        <?php
           //here put script to generate your data       
         ?>
     ]]>
  </Content>
</Module>

Hi osjimon,

Did you make sure the file was named .htaccess?

Also some hosts don't allow you to write .htaccess files so you might want to check that.

 

I was able to get this working using this file:

RewriteEngine on

RewriteBase /

RewriteRule ^test\.xml$ test.xml.php

 

Hope some of that helped.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.