View Full Version : Exporting data to text file...

Supa Rem
02-27-2011, 04:39 PM
Hi All,

First of all an apology - I am an ICT teacher who has never used Dreamweaver before...

My A level class have to create a website which takes registration data in to a form on one page and then on a button click saves it and pushes it for display on a confirmation page...and I have NO idea how to do it.

I have managed to create a form complete with a table, labels, text fields and a button and have no idea about where to go next. I don't know anything about PHP, and am pretty sure that we couldn't use it on our school network anyway. I'm not looking for a "pretty" or "clever" solution here, just literally a rough and ready setup that will work once!!!

So basically I need to:
1. Write the data in the text fields to a text file
2. Load a confirmation page that either reads the data from the text file or somehow cleverly grabs it from the previous page

Please, please, please can someone help? I promise to try to understand everything that you say :lol:

Thanks in advance,

02-27-2011, 09:21 PM
You're going to need a php or cgi script to handle this for you.

Supa Rem
02-27-2011, 09:56 PM
Thanks DWCourse, now I just need to work out what all that means :)

02-27-2011, 10:31 PM
It means that all the form basically does is collect the data that it entered and send it off to a script on your server that processes it and adds it to a database, sends it in an email or, in your case, uses it to create a page.

There is a commercial ($30) program I like to use called Forms To Go from Bebosoft (http://bebosoft.com/products/formstogo/overview) that can build a script and send data to a landing page.

Perhaps someone else here can point you to a free program or give you some tips on writing the script.

02-28-2011, 01:34 AM
the php function that will do this is fwrite if that is any help to you in your search , have a look at tizag.com see if you want to learn or go for a pre made solution as suggested

Supa Rem
02-28-2011, 11:40 AM
Thanks both - we have no money to spend, so I'll be looking at tigzag :)

03-02-2011, 11:40 AM
Does it have to read the file?

Does it have to store the data in a file?

What technologies are available to the students if PHP is not available?

Supa Rem
03-02-2011, 08:08 PM
It has to save the data, but file type isn't specified.
Our techie guys are working on a web server that will be available to the kids, so hopefully we will be able to use PHP.

03-03-2011, 04:00 AM
get your techs to look at using PEAR there is a package for creating excel files, never used it though

03-03-2011, 06:43 AM
I think I have a php script that will do this for you. It collects data from a form and creates a csv file on the server. (comma separated values) that can be opened up and viewed nicely in Excel or any spreadsheet app.

email me richard@qwerty-design.co.uk and I'll send you the package with the form. I'll also post the code here for others.



Supa Rem
03-03-2011, 07:23 AM
WOW! Thanks Ricky55 and everyone else for your really helpful suggestions.