Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Transform Html data into xml

    Code:
    <html>
    <title>Student Registration </title>
    <body>
    <form name="fin" action="2.php" Method="post">
    <table>
    <Caption> Student Registration </Caption>
    <tr>
    <td>
    Student Name: <input type='text' name='Sname' />
    </td></tr>
    <tr>
    <td>
    Student id: <input type='number' name='Sid' />
    </td></tr>
    <tr>
    <td>
    Student Class: <input type='text' name='Sclass' />
    </td></tr>
    <tr>
    <td>
    <input type='submit' value='Next" />
    </td></tr>
    </table>
    </form>
    </body>
    </html>
    
    When ever user clicks on next page he/she will redirected to 2.php
    at dat time i want to store all the form data in xml.
    here 2.php code Follows:
    
    <?php
    ?>
     <html>
    <title>Student Registration2 </title>
    <body>
    <form name="fin2" action="#" Method="post">
    <table>
    <Caption> Student Backgroun Details </Caption>
    <tr>
    <td>
    Student Name: <input type='text' name='Sname' />
    </td></tr>
    <tr>
    <td>
    Father Name: <input type='number' name='Fname' />
    </td></tr>
    <tr>
    <td>
    Father OCupation: <input type='text' name='Foc' />
    </td></tr>
    <tr>
    <td>
    Permanent Address: <input type='text' name='Add' />
    </td></tr>
    <tr>
    <td>
    <input type='submit' value='Submit" />
    </td></tr>
    </table>
    </form>
    </body>
    </html>
    So wen ever user clicks Submit on 2page.here the registration completes.
    At dis time i want to Retrive the Data of 1st page From Xml. & now I want to store all the data from (1st & 2nd page) in my database.

    finally i need 2 things
    1. how to store the data in xml.
    2. how to fetch the saved data in xml
    3.by doing 1 & 2 i want to insert all data in my database
    Last edited by VIPStephan; 10-16-2012 at 09:34 AM. Reason: fixed code BB tags

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,445
    Thanks
    23
    Thanked 630 Times in 629 Posts
    Why wood u want 2 do dat? All dat extra code in the html to make xml and den u need to store dat xml. How u do dat? U put it in da database. Y not just store the info wid out the xml conversion. So much easier.

  • #3
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts
    While sun is right that the intuitive approach is by using server side scripting, you can
    Use XML DOM to do this.

    I have not looked into it, but hopefully looking over http://www.w3schools.com/dom/default.asp
    Demonstrations, you can give a shot at it.

    It is good practice.

  • Users who have thanked DELOCH for this post:

    Varma513 (10-17-2012)

  • #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Look up how PHP handles HTTP POST form submissions and you'll be off to a good start.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • Users who have thanked Alex Vincent for this post:

    Varma513 (10-17-2012)

  • #5
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    with out using xml.i can do this by using sessions.nut sessions can be declared at server side right,even i dont want to declare the variable at server side,instead of declaring variables i feel using xml makes server burdeon low ..is it possible...????

  • #6
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    The problem is XML documents aren't written in a scripting language nor a programming language, so there's no specific interpreter or compiler to translate the contents into machine code. You have to write them (unless you're writing in a very well-supported XML language like XHTML).

    XML documents are good for exchanging data between incompatible systems, but they are not programs in and of themselves.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

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