Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Generate XML with PHP (bascis)
Old 03-17-2009, 11:36 AM Generate XML with PHP (bascis)
Junior Talker

Posts: 1
Trades: 0
Hi there!

Im currently working on a script which allows me to enter new posts in a XML-file.

The XML ("config.xml") is read by a flash application to show videos. The XML-template is as follow, and is entered for each new movie I want to publish:
Code:
      <item>
         <title>$title</title> // from form ($_POST)
         <description><![CDATA[$description]]></description> // short description of movie
         <url>$URL</url> // URL to the moviefile (FLV)
         <thumb>$thumb_url</thumb> // URL to thumbnail
      </item>
I've created a short PHP-script which allows me to enter this details through a form. All items is wrapped with <movie> and </movie>, and using the fgets()-function with a "while", the script is searching for the first <movie>-line and place the new entery right below it.

The source code is to be found here: http://norskwebforum.no/pastebin/10961 (text in norwegian, but I think you'll understand the point).

Now, I really want to add the functionality to edit and delete posts, but I don't know how to do this. Maybe I can generate the XML with a database, but I started with PHP to weeks ago, so I'm still pretty n00b at this.

So any help would've been much appriciated!
Marjoth is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-19-2009, 10:16 AM Re: Generate XML with PHP (bascis)
Skilled Talker

Posts: 84
Trades: 0
Either you can create the xml with the database or I would suggest you create a feed or master xml with the root node as movie as you mentioned and give specific ids for the items which you can use for identifying the posts.

Use xquery and Xpath to make changes to the xml file.

Hope this helps ..
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
- 1-888-869-HOST(4678)
Award winning Managed Hosting -
Please login or register to view this content. Registration is FREE

Managed Dedicated Servers. Reseller Discounts. 24/7 Impressive Tech Support
HivelocityDD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Generate XML with PHP (bascis)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13249 seconds with 12 queries