Jump to content

generate XML on the fly using PHP not showing correct output.


jason310771

Recommended Posts

i have added the following line to my .htaccess

 

AddType application/x-httpd-php .xml

 

so the server executes the xml file as php but the resulting xml file shows is the original php file itself and not the xml song list.

 

<?xml version="1.0" encoding="UTF-8"?>
<songs>
<?php
$originalArray = array (	"Test1"  => array (	"Test1",
									"Twodded Band",
									"songs/test1.mp3"
									),
				"Test2"  => array (	"Test2",
			  						"P2L Band",
									"songs/test2.mp3"
									),
				"Test3"  => array (	"Test3",
			  						"Fast_N_Furios",
									"songs/Fast_N_Furios.mp3"
									),
				"Test4"  => array (	"Test4",
			  						"Titanic",
									"songs/Titanic.mp3"
									),
				"Test5"  => array (	"Test5",
			  						"Welcome",
									"songs/Welcome_To_Hollywood.mp3"
									),
				"Test6"  => array (	"Test6",
			  						"VODAFONE",
									"songs/Vodafone_New_Ad.mp3"
									)
                );
// randomize the order of the array in to a new array $newArray
foreach ($originalArray as $na) {
echo('<song name ="' . $na[0] . '" band ="' . $na[1] . '" file="' . $na[2] . '" />');
}
?>
</songs>

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.