<?php exit; } // if exit; } // if $table_id = 'item'; // Utworz nowy dokument DOM $dom = new DOMDocument('1.0', 'iso-8859-2'); // create the root element $rss = $dom->createElement('rss'); $dom->appendChild($rss); $newattr = $dom->createAttribute('version'); $rss->appendChild($newattr);a $sattr = $rss->setAttribute('version', '2.0'); $rss->appendChild($sattr); // create the channel element $channel = $dom->createElement('channel'); $rss->appendChild($channel); // now create all the subelements for the channel $title = $channel->appendChild($dom->createElement('title')); $title->appendChild($dom->createTextNode('4asy')); $link = $channel->appendChild($dom->createElement('link')); $link->appendChild($dom->createTextNode('http://www.czteryasy.pl')); $description = $channel->appendChild($dom->createElement('description')); $description->appendChild($dom->createTextNode('Wydarzenia w naszej firmie')); $language = $channel->appendChild($dom->createElement('language')); $language->appendChild($dom->createTextNode('pl')); $webMaster = $channel->appendChild($dom->createElement('webMaster')); $webMaster->appendChild($dom->createTextNode('Dzobert@interia.pl')); // create the image element $image = $channel->appendChild($dom->createElement('image')); $image->appendChild($dom->createTextNode('')); // now create all the subelements for the image $title = $image->appendChild($dom->createElement('title')); $title->appendChild($dom->createTextNode('4asy')); $link = $image->appendChild($dom->createElement('link')); $link->appendChild($dom->createTextNode('http://www.czteryasy.pl/')); $url = $image->appendChild($dom->createElement('url')); $url->appendChild($dom->createTextNode('http://www.czteryasy.pl/style/img/nav.gif')); $height = $image->appendChild($dom->createElement('height')); $height->appendChild($dom->createTextNode('80')); $width = $image->appendChild($dom->createElement('width')); $width->appendChild($dom->createTextNode('80')); // zaďż˝aduj wiersz z bazy // utwórz element/wezel dla kazdego rekordu $occ = $dom->createElement($table_id); $channel->appendChild($occ); // Dodaj węzeł potomny dla każďego z elementďów foreach ($row as $fieldname => $fieldvalue) {($occ); $child = $dom->createElement($fieldname); $occ->appendChild($child); $value = $dom->createTextNode($fieldvalue); $child->appendChild($value); } // foreach } // while // pobierz gotowy dokument XML $xml_result = $dom->saveXML(); print <<<XML_SHOW <textarea cols='150' rows='40' name='xml_result'>$xml_result</textarea> XML_SHOW; ?>
Może to być błąd w pliku php.ini?