Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2012, 11:36 AM   PM User | #1
Varma513
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
Varma513 is an unknown quantity at this point
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
Varma513 is offline   Reply With Quote
Old 10-15-2012, 04:28 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
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.
sunfighter is offline   Reply With Quote
Old 10-15-2012, 04:47 PM   PM User | #3
DELOCH
Regular Coder

 
DELOCH's Avatar
 
Join Date: Apr 2006
Location: Canada
Posts: 537
Thanks: 4
Thanked 2 Times in 2 Posts
DELOCH is an unknown quantity at this point
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.
DELOCH is offline   Reply With Quote
Users who have thanked DELOCH for this post:
Varma513 (10-17-2012)
Old 10-16-2012, 01:26 AM   PM User | #4
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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
Alex Vincent is offline   Reply With Quote
Users who have thanked Alex Vincent for this post:
Varma513 (10-17-2012)
Old 10-17-2012, 10:48 AM   PM User | #5
Varma513
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
Varma513 is an unknown quantity at this point
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...????
Varma513 is offline   Reply With Quote
Old 10-17-2012, 04:58 PM   PM User | #6
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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
Alex Vincent is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 10:38 PM.


Advertisement
Log in to turn off these ads.