OK so here is what i wanna do. I been researching for a while but i didnt find the answer maybe you guys could help me out a little.
I wanna create a xml table from a MySQL data base query using something like this:
$file= fopen("results.xml", "w");
$_xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n";
$_xml .="<site>\r\n";
while ($row = mysql_fetch_array($result)) {
if ($row["pageTitle"]) {
$_xml .="\t<page title=\"" . $row["pageTitle"] . "\">\r\n";
$_xml .="\t\t<file>" . $row["pageLink"] . "</file>\r\n";$_xml .="\t</page>\r\n";
}
else {
$_xml .="\t<page title=\"Nothing Returned\">\r\n";$_xml .="\t\t<file>none</file>\r\n";
$_xml .="\t</page>\r\n";
}
}
$_xml .="</site>";
fwrite($file, $_xml);
fclose($file);
echo "XML has been written. <a href=\"results.xml\">View the XML.</a>";
OK i get that to work and i have it styled with a nice XSL too but the problem is this.
I wanna
echo $_xml;
var on one of my web pages, but i cant.
I read that i need to change the --> header ("content-type: text/xml");
But i cant do that because i have other output on the page.
So if i put it on the top of the page, the page dosent display right (if anything at all),
and i cant put it right above the
echo $_xml;
because then i get a
Warning: Cannot modify header information
and then i read this:
$mosConfig_locale_debug = 0;
$mosConfig_locale_use_gettext = 0;
add these two lines in configuration.php
but i cant Find that file.
IS the there anyways around this???
Im dying here.