Results 1 to 2 of 2

Thread: Generating an XML File

  1. #1
    alliance_studio Guest

    Exclamation Generating an XML File

    I am currently working on an ordering system that requires users to add to basket, confirm their basket, add a delivery address and then place an order.

    One they have placed the order, the contents of their basket along with their delivery address is saved to a MySql database. This is all done using PHP and sessions.

    Now to the part I'm stuck on...

    All the information about the order that is being saved to the database also needs to be compiled into an XML which will then be sent to an IP address however I have no idea on how this can be accomplished.

    Any help will be greatly appreciated!

  2. #2
    Join Date
    Mar 2010
    Location
    England
    Posts
    1,144
    just use the php file functions: http://www.php.net/manual/en/ref.filesystem.php
    PHP Code:
    <?php
    $fh 
    fopen'filename.xml''w' ); // to create an xml file, or open an existing on with that same name;

    $xml_contents "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
    <note>
        <to>Tove</to>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
    </note>
    "
    ;

    fwrite$fh$xml_contents );

    fclose$fh );
    `i think thats right, something along those lines. I havn't written anything for files for a long time so could be a little rusty.

Similar Threads

  1. XML file of DVD catalog - now what??
    By etcetera in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 07 Jan 2010, 02:50 PM
  2. Replies: 1
    Last Post: 28 Apr 2007, 10:41 PM
  3. Posting Data from XML file?
    By sixstringlass in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 26 Feb 2007, 10:40 AM
  4. Appending New XML To An XML File With PHP
    By Streakfury in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 27 Mar 2006, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •