php and xml

Hi there I need to design a web page that will take some attributes
from an xml data file and load its content into a database

I have a personal web server running mysql and php 4.3 and i can
design web pages etc.

What sort of script would enable me to do this? Obviously I would
need to access the database using INSERT commands of sql but how do
i get php to access the xml file and retreive the data I need?

could anyone set me off or perhaps recommend a tutorial or two?
paranoid-android [ Do, 30 Dezember 2004 12:59 ] [ ID #559300 ]

Re: php and xml

paranoid-android wrote:
> What sort of script would enable me to do this? Obviously I would
> need to access the database using INSERT commands of sql but how do
> i get php to access the xml file and retreive the data I need?
>

http://www.php.net/simplexml
http://www.php.net/dom
http://www.php.net/xsl
http://www.php.net/xml



JW
Janwillem Borleffs [ Do, 30 Dezember 2004 15:34 ] [ ID #559303 ]

Re: php and xml

thank you very much for your help.
paranoid-android [ Do, 30 Dezember 2004 16:42 ] [ ID #559308 ]

Re: php and xml

Hi

Use simplexml.. It works pretty well.......

Here is some sample code to return specific values in the xml file.....
$file = "http://domain.com/skillset.xml";

$xml = simplexml_load_file($file);

//Prints the values based on array value

print "<br>SkillsetName:
".$xml->SkillsetStatistics->SkillsetStats[5]->Skillsetname;

print "<br>Calls Offered
".$xml->SkillsetStatistics->SkillsetStats[5]->CallsOffered;

print "<br>Calls Answered
".$xml->SkillsetStatistics->SkillsetStats[5]->CallsAnswered;

print "<br>Calls Abandoned
".$xml->SkillsetStatistics->SkillsetStats[5]->SkillsetAbando ned;

print"<br><br>";



Hope this helps


"paranoid-android" <paranoid-android [at] ntlworld.com> wrote in message
news:C4SAd.127$z11.83 [at] newsfe6-win.ntli.net...
> Hi there I need to design a web page that will take some attributes
> from an xml data file and load its content into a database
>
> I have a personal web server running mysql and php 4.3 and i can
> design web pages etc.
>
> What sort of script would enable me to do this? Obviously I would
> need to access the database using INSERT commands of sql but how do
> i get php to access the xml file and retreive the data I need?
>
> could anyone set me off or perhaps recommend a tutorial or two?
ray [ Fr, 31 Dezember 2004 08:26 ] [ ID #560612 ]
PHP » alt.php » php and xml

Vorheriges Thema: Disallow browser access
Nächstes Thema: visual php query editor