Help me Error in PHP and XML

A

Anonymous

Guest
Good day!

Can any body help me... Im stuck in this problem

I have a PHP script that will tells the browser, and any other program that will be using this file, to interpret it as XML and not as PHP. Code Bellow.

but I have a problem or Error Occured during i run this script.
Error Bellow:

XML Parsing Error: xml processing instruction not at start of external entity
Location: http://localhost:81/Flash%20Projects/SampleFlash/xml.php
Line Number 1, Column 3:

Can any Body help me to fix it...or explain me dhy it was occured. Your Help is greatly Appreciated.

thanks A LOT

Code:
<?php
header("Content-type: text/xml");
$xml_output ="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
$xml_output .="<gallery timer=\"5\" order=\"sequential\" fadetime=\"2\" looping=\"yes\" xpos=\"0\" ypos=\"0\">\n";

?>
<?
$host = "localhost";
$user = "root";
$pass = "";
$database = "anastasio";

$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");

$query = "SELECT * FROM titles ";
$resultID = mysql_query($query, $linkID) or die("Data not found.");


for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
    $row = mysql_fetch_assoc($resultID);
   
    $xml_output .= "<image path=\"images/" . $row['Image'] . "\" />\n";
  
}

$xml_output .= "</gallery>";

echo $xml_output; 
?>
[/code]
 
Hi,

I copy the code and try to find the error.
I dont get any error.

I think u want to create xml file and want to use that file in flash animation.

If am I right,
Please create a xml file using file functions and then try to acces that in your animation.

If I am wrong please tell me what do u want to do?
 
Thanks Mukseh!

really there is no error in you.

Coz in me here i have encounter error like this:

XML Parsing Error: xml processing instruction not at start of external entity
Location: http://localhost:81/Flash%20Projects/SampleFlash/xml.php
Line Number 1, Column 3:

Yes yo are true... I want to create an XML file that i will used in flash animation.
is there i will configure in php.ini file to execute XML?

SO you suggest that that i will make a php file function that will create an XML file.

Do you have any link that you know about how to make create a file in php?

Coz im not familiar in file funtions...Thanks Bro
 
Hi,

Here you do not need to do enything extra.

Just use fopen fuction to create xml file.

You have to just remember that where to close proper xml tag.
 
Back
Top