0

Hi to all
I use a cms and I want to modify an its module.
I need to pass a variable to a xml file (this xml is necessary for a flash slideshow), like the value of a folder like '/example'
If I create a system variable in php and then I recall it in xml, is it possible?

byee

Edited by maofree: n/a

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by maofree
0

Hi,

I'm not aware of the ability to pass a variable from PHP to XML.

One option to consider is to use PHP to generate the XML file. This would involve setting the correct content type headers so that when the PHP script is called, the resulting output is served as XML.

R.

0

Thanks blocblue

Do you know a simple good guide or site (URL) to learn how to use PHP to generate a XML file?
It's not so simple

byee

0

PHP has several inbuilt functions for producing XML. See the SimpleXML pages.

Alternatively, you can just do something like:

<?php

header('Content-type: text/xml');
$example = 'Example variable value';

echo "<?xml version="1.0"?>
<example>
    <variable>
        <value>{$example}</value>
    </variable>
</example>";

R.

Edited by blocblue: n/a

0

thank you very much for your time
you're very kind

Now I've understood what you've said before (This would involve setting the correct content type headers so that when the PHP script is called, the resulting output is served as XML.)
It's the same thing to pass some variables to css file from php file

I'm glad to know you

byee

Edited by maofree: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.