Jump to content


Photo

PHP XML editor


  • Please log in to reply
1 reply to this topic

#1 Largo .//npc

Largo .//npc

    Young Padawan

  • Members
  • Pip
  • 38 posts

Posted 11 March 2007 - 10:12 AM

Hi all.
I've created a flash website that uses XML to update all content on the site, each page has it's down XML file.

I was wondering if anyone could help me make a passworded PHP page to edit and update these PHP files so the other admins can easilly do this, as they don't know much about XML ect.
I've only dabbled in PHP before, editing PHP engines such as phpbb, LDU ect.

A couple of my xml files look like this:

poems.xml (this is for the news post. I used a tutorial for creating it and never bothered changing it from poems to news.)
<?xml version="1.0" encoding="UTF-8"?>
<poems>
  <poem by="Jon" date="11th March 2007" id="1"
  image1="images/news/tbcsmall.jpg" image2="images/news/tom.jpg"
  image3="images/news/bass2.jpg" title="Website under way"
  url1="images/bigger.jpg" url2="images/bigger.jpg"
  url3="images/bigger.jpg">After weeks of work, with a tiny break in between to play a few games, the website is now well under way. Almost all the pages are finished, and content is slowing being added. Hopefully we can get a domain name soon and get it hosted!</poem>
</poems>

bios.xml
<bios>
<bio membername="Jacob" id="4" image1="images/bio/jacob3.jpg" image2="images/bio/jacob2.jpg" image3="images/news/tbcsmall.jpg" instrument="Guitar and Vocals">Blah Blah blah 1 2 3 no yes no blah blah</bio>
<bio membername="Adam" id="3" image1="images/bio/bass1.jpg" image2="images/news/bass2.jpg" image3="images/bio/pint.jpg" instrument="Guitar and Backing Vocals">kdjj isje id sof s eud oijd askjdjka oa jsda</bio>
<bio membername="Sean" id="2" image1="images/bio/kitchen.jpg" image2="images/bio/aaaya.jpg" image3="images/news/tom.jpg" instrument="Drums">dksmf sme ls eld salkdlsk alksdf lkasd l,a sdlkasldklasd lkaskldklskdlkaslkjf dlklkaldkflasklasklkd alskdlaskd asdlkasldksaldkalsdklasdkalsdlakdlaskakdlaskdlaskdlaskdlaskdlaskdlaskdlaskdlaskd
lakdlakdlaskdlaskdlaksdlaskdlaskdlasdlaskdas aalskdla alsdalskdas daksdlasd</bio>
<bio membername="Jon" id="1" image1="images/bio/targetsmall.jpg" image2="images/bio/textsmall.jpg" image3="images/news/tbcsmall.jpg" instrument="Bass">Nark nark nip woop bab sksk isuw is wiska k akd skd sksd skd</bio>
</bios>

gallerys.xml
<gallerys>
<gallery id="3" image="images/thumbs/jacob400x320.jpg" imageurl="images/jacob.jpg" info="Jacob during practice"></gallery>
<gallery id="2" image="images/thumbs/morebass400x320.jpg" imageurl="images/morebass.jpg" info="A bit of crazy bassing"></gallery>
<gallery id="1" image="images/thumbs/sean400x320.jpg" imageurl="images/sean2.jpg" info="Sean in a kitchen..."></gallery>
</gallerys>

Thanks for looking.

#2 Matthew.

Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 11 March 2007 - 10:35 AM

Instead of actually editing the XML file, it would be better to set ut with with a database backend and actually produce it from that each time.

As for how to do that, everything you need can be found on the P2L index and php.net. Look up database integration (MySQL) and pretty much all the required fucntions etc you will need can be found on those pages.

Matt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users