Online XML Editor

Discussion in 'PHP' started by astrazone, Oct 30, 2009.

  1. #1
    I am trying to make an online XML editor that will give all the attributes and nodes in a form.

    My XML file:
    
    <xml>
        <photos>
             <photo url="images/image1" desc="best image ever" cat="1" />
             <photo url="images/image2" desc="my photo" cat="2" />
             <photo url="images/image3" desc="me and my friends" cat="3" />
        </photos>
    </xml>
    
    PHP:
    I need an input box for each <photo> with all attributes as the value.
    and after submit button is pressed it will update the XML.

    Example :
    
    <form name="input" action="update.php" method="get">
         <input type="text" name="url" value="images/image1" />
         <input type="text" name="desc" value="best image ever" />
         <input type="text" name="cat" value="1" />
         <input type="submit" value="Update XML" />
    </form>
    
    PHP:
    Thanks in advance.
     
    astrazone, Oct 30, 2009 IP
  2. akram123khan25

    akram123khan25 Active Member

    Messages:
    102
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    nice sharing for us
     
    akram123khan25, Oct 30, 2009 IP
  3. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    what are you talking about? I cant figure out how to do it so I am asking for help.
     
    astrazone, Oct 30, 2009 IP
  4. cubicaaron

    cubicaaron Guest

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's probably a little too late to help you, but Im sure future readers could get some help here.

    Basically you will need to post your form to a server side scripting language, i.e. PHP.

    Then this will use the PHP $_POST['attribute_name']; format to pull in the urls that were posted through the form.

    Yuo can then start building an XML document within PHP, under the usage of the XML DOM methods, then print or save the string into a .xml document.

    A lot of information can be found online, on sites like PHP.net

    Uploading the file is another matter, maybe use a jQuery app to upload it into your web server???
     
    cubicaaron, Aug 19, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #5
    danx10, Aug 19, 2010 IP