Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

php read write xml

[es] :: PHP :: php read write xml

[ Pregleda: 2192 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

xxxrugby

Član broj: 16068
Poruke: 653
*.adsl.net.t-com.hr.

Sajt: www.zagreb-rugby.hr


Profil

icon php read write xml06.02.2007. u 13:06 - pre 209 meseci
Na serveru gdje imam sajt je PHP 4.4

ok. DOM-a nema. I sad ipak prava da ubacim u usr/lib/php nemam.

Kako da ubacim neki PHP reader writer library. Bilo sta.

Samo da citam XML. i pisem. Ili neki tutorial tu vrludam po netu vec o tome. nemogu vise ni geldat.

evo i poruka od jednog nacina
Call to undefined function xmldocfile()
xxxrugby: "We are all philosophers, when question is about politics!"
 
Odgovor na temu

xxxrugby

Član broj: 16068
Poruke: 653
*.adsl.net.t-com.hr.

Sajt: www.zagreb-rugby.hr


Profil

icon Re: php read write xml07.02.2007. u 09:13 - pre 209 meseci
rjesio

Code:
            //XML file
            $xml = new DomDocument('1.0');
            $xml-> load ('xml/slike.xml');
        
            $slike = array();
            $XMLSlike = $xml->getElementsByTagName('slike)->item(0);
            
            foreach($XMLSlike->getElementsByTagName('slika') as $slikeNode)
            {
                $pozicija = $slikeNode->getElementsByTagName('pozicija')->item(0)->firstChild->nodeValue;
                if ($pozicija == "lijevo")
                {
                    $ime = $slikeNode->getElementsByTagName('ime')->item(0)->firstChild->nodeValue;
                    $sirina =  $slikeNode->getElementsByTagName('sirina')->item(0)->firstChild->nodeValue;
                    $url = $slikeNode->getElementsByTagName('url')->item(0)->firstChild->nodeValue;
                    $img_path = $sponzorNode->getElementsByTagName('img_path')->item(0)->firstChild->nodeValue;
                    
                    echo "<div align =center>";
                    echo "<hr color=\"#0000FF\" size=\"1\" width=\"165\">";
                    echo "<a href=\"$url\">";
                    echo "<img border=\"0\" src= $img_path width = $sirina, alt = \"$ime\"></a></img>";
                    echo "</div>";

xxxrugby: "We are all philosophers, when question is about politics!"
 
Odgovor na temu

[es] :: PHP :: php read write xml

[ Pregleda: 2192 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.