Current location: Hot Scripts Forums » General Community » Script Requests » How to write a .csv file with data from multiple forms?


How to write a .csv file with data from multiple forms?

Reply
  #1 (permalink)  
Old 10-02-08, 05:14 PM
ajinc ajinc is offline
New Member
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How to write a .csv file with data from multiple forms?

Hello All,
I have a script generator that will write to a .csv file from the designed page.
I would like to know if someone could tell me a technique to write a single record with data from multiple web pages for example.

1'st page ask for name, address, phone,email <click submit> got to next page

next page ask for some variable numeric info that calcs are performed on and display in the page as well as being written to the record.
Does anyone know of a script that works similar to this , or can give a php novice pointers as how to acomplish this.

Thanks in advance
ajinc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-03-08, 06:08 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
I'd store all of the data in sessions until the final page, then calculate, display, and write ti the file as needed.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-04-08, 07:00 AM
ianbrind ianbrind is offline
Wannabe Coder
 
Join Date: Jul 2008
Location: Somerset UK!
Posts: 192
Thanks: 0
Thanked 0 Times in 0 Posts
On the 2nd page I would use some hidden inputs holding the post values from the first page.

page1.php
HTML Code:
<form action="page2.php" method="post" />
Name:<input type="text" name="yourName" /><br />
<input tpre="submit" name="submit" value=">>Next" />
</form>
page2.php
PHP Code:

<?php
if (!isset($_POST['submit'])){
header("Location: page1.php");
}
else{

$yourName=$_POST['yourName'];
?>

<form action="done.php" method="post" />
<input type="hidden" name="yourName" value="<?php echo $yourName?>" />
Other Data: <input type="text" name="otherData" /><br />
<input type="submit" name="submit" value="Finish!" />
</form>

<?php
}
?>
done.php
PHP Code:

$yourName $_POST['yourName'];
$otherData $_POST['otherData'];

// do something
// do the maths

// write to csv 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit button data written to a .txt file ziul Everything Java 0 08-08-07 04:41 PM
Checking a file exists lee PHP 3 04-23-06 01:44 AM
one-page form/catalog in php, data fed in with .csv file? domaky PHP 2 10-25-03 10:32 AM
PHP - Dir listing and write to file NickyWhicko PHP 4 08-24-03 03:42 AM
Upload file type and size limiter! Arctic ASP 1 08-02-03 08:06 PM


All times are GMT -5. The time now is 10:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.