Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Bidding Directory   High Bandwidth Dedicated Servers   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 10-15-2003, 07:24 PM   #1 (permalink)
Inactive
 
Join Date: 10-15-03
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

farns is liked by many
Formmail data to a .CSV file

Hello,

I need to construct a formmail page where my users will fill in the blanks, select from pull downs, radios, etc... and have all of that sent to me in a comma seperated file. Can anybody recommend a script to me? An added bonus would be if the script could be configured such that a user could make entry after entry (example, they will be entering in names, addresses and phone numbers... and if they have 12 to do in one sitting...) and then submit the entire lot at once, with one CSV file.

I may have to take this in 2 steps if that second part is a huge deal... but at least I need the form results to be either sent to me or stored on the server in a .CSV file. Any thoughts??

Eric
farns is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-16-2003, 06:48 AM   #2 (permalink)
Administrator
 
fishfreek's Avatar
 
Join Date: 10-13-03
Location: Virginia
Posts: 2,073
iTrader: 0 / 0%
Latest Blog:
None

fishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of light
Send a message via ICQ to fishfreek Send a message via AIM to fishfreek Send a message via MSN to fishfreek Send a message via Yahoo to fishfreek
This is what I would suggest.

A webform that had a mysql database backend. Users submitted data via the form and the data was entered into the mysql database for storage.

Another webscript could be constructed to basicly export the mysql database in CSV format or you could then use phpmyadmin (a php based mysql interface) to export the database in CSV format.
fishfreek is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 07:41 AM   #3 (permalink)
Inactive
 
Join Date: 10-15-03
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

farns is liked by many
Hmm... I"d like to stay away from mysql and php if possible, not because I think they are bad, but just because they are beyond my understanding right now. There is no need for this to be stored in a database, once the data has been presented to me, there is no need for it to linger. I'm simply looking for a way to get the data to me in a format that I can use in a spreadsheet. Right now, I have to take the form results and copy/paste each field into an excell file. I'm trying to eliminate the hand-work, as we expect the volume of forms processed to increase greatly.
farns is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 08:04 AM   #4 (permalink)
Administrator
 
fishfreek's Avatar
 
Join Date: 10-13-03
Location: Virginia
Posts: 2,073
iTrader: 0 / 0%
Latest Blog:
None

fishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of light
Send a message via ICQ to fishfreek Send a message via AIM to fishfreek Send a message via MSN to fishfreek Send a message via Yahoo to fishfreek
Quote:
I'm trying to eliminate the hand-work, as we expect the volume of forms processed to increase greatly.
That is the exact reason to automate the process. If you have the webform e-mail you every time the form is filled out and you have a lot of these forms getting filled out your day is going to end up being fill with just inserting these into the spreedsheet.

You could design the form to write the results to a text file on the server and then go in say once a day or once a week or something and download the text file and bulk process them that way.

I was imitated with php and mysql before I learned myself. One day I decided I needed to code a custom script so I got myself a few mysql books and a few php books and taught myself.

You said your entering it into a spreadsheet so the data is lingering on in some manor. Is there a reason your putting it into excel? Are you taking the info and making charts out of it or doing calculations based upon teh info? Or is excel just a storage medium?
fishfreek is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 08:28 AM   #5 (permalink)
Inactive
 
Join Date: 10-15-03
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

farns is liked by many
The data collected in processed through our MIS system and used for mailing stuff. In simplified terms, a user enters their name, address, zip, and chooses some options from pull down menus.

the CSV file I need in the end, has all these entries in seperate fields. our MIS system process that, calculates zip+4 for mailing, and use those selected "options" from the pull downs to tell our software which version of a particular postcard that person needs to receive.

Hmmm... maybe I DO need to give the mysql thing a shot. I know my servers support it, would you recommend myphpadmin to run it? I know I can install that pretty easy as well.

What books have you read that you might recomend to me?
farns is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 08:34 AM   #6 (permalink)
Administrator
 
fishfreek's Avatar
 
Join Date: 10-13-03
Location: Virginia
Posts: 2,073
iTrader: 0 / 0%
Latest Blog:
None

fishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of light
Send a message via ICQ to fishfreek Send a message via AIM to fishfreek Send a message via MSN to fishfreek Send a message via Yahoo to fishfreek
phpmyadmin is basicly a backdoor web based interface to mysql. You can use it to create a database and to setup the tables and fields. You can then use it to manipulate the data to some extent as well as to export the data in any number of methods.

I cant list the books I used right now as I dont recall the titles. WHen I get home ill try to remember to look them up.
fishfreek is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 02:01 PM   #7 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
You can use JavaScript to format the data into CSV if CSV is just text.
Then the simple PHP script can either write it to a file on the server, or paste it into an email and send it to you.

Your server will have to either have a folder with read write and execute access for the script, or access to a mail sender, emails can usually be sent with the mail() function in PHP as long as the server owner has not turned it off.
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-16-2003, 03:07 PM   #8 (permalink)
Administrator
 
fishfreek's Avatar
 
Join Date: 10-13-03
Location: Virginia
Posts: 2,073
iTrader: 0 / 0%
Latest Blog:
None

fishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of light
Send a message via ICQ to fishfreek Send a message via AIM to fishfreek Send a message via MSN to fishfreek Send a message via Yahoo to fishfreek
Ok the books I used to learn where entitled

MySQL by Paul DuBois
Teach Yourself PHP4 in 24 Hours Sams Publishing
PHP and MySQL in Web Development

I had a few others but those where the main reference materials
fishfreek is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-20-2003, 11:36 AM   #9 (permalink)
Inactive
 
Join Date: 10-20-03
Posts: 21
iTrader: 0 / 0%
Latest Blog:
None

Culland is liked by many
The best way in my opinion is what lazyjim said, though personally I would format it into the comma deliminated string using PHP, but if you want to limit your learning curve doing the formating with javascript would work as well.

Spend a few moments and go to php.net, best learning resource for PHP and its free. Specifically take a look at:

http://ca2.php.net/manual/en/function.fopen.php

fopen() is very easy to use and there are lot of examples there on the page, I use fopen() and its more complext partner fsockopen() probably more than anything else, well worth the time to check it out.

Cul
Culland is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-20-2003, 09:09 PM   #10 (permalink)
Inactive
 
Join Date: 10-13-03
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

encounter779 is liked by many
I'm not sure how to export form data to a mysql database, but once you figure that out, I've found a tutorial to export your data from the database to an Excel file. It's very easy and short. Just go to this URL.

http://www.phpfreaks.com/tutorials/114/0.php
encounter779 is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-21-2003, 03:09 AM   #11 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
Culland, thanks for you input, and I agree it would be a better learning experience to do it all with PHP.

However, formatting the data into plain-text with the comma's/tabs/crlf or whatever .csv uses on the client side will save the server from some processing. This is a form of disributed computing. But may not be important in this particular case.

The dissadvantage of useng JavaScript, is that not everyone has it turned on or even available in their browsers.
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-21-2003, 09:15 AM   #12 (permalink)
Inactive
 
Join Date: 10-20-03
Posts: 21
iTrader: 0 / 0%
Latest Blog:
None

Culland is liked by many
Agreed! I think I am a bit to server intensive in my code cause I get tired of getting something to work and then finding it wont work in one browser type or as you said someone comes along with javascript disabled, which according to the stats is like 13% of browsers on the web from the stat I saw the other day.

It however is good to be reminded that not everything has to be done server side

Cul
Culland is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-22-2003, 11:25 AM   #13 (permalink)
Inactive
 
Join Date: 10-13-03
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

encounter779 is liked by many
I use phpMyAdmin for some of my database stuff and I just found that there is an option to export a table in .csv format. This should help once you get the data into the database and need to export it to excel
encounter779 is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-22-2003, 12:42 PM   #14 (permalink)
Administrator
 
fishfreek's Avatar
 
Join Date: 10-13-03
Location: Virginia
Posts: 2,073
iTrader: 0 / 0%
Latest Blog:
None

fishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of lightfishfreek is a glorious beacon of light
Send a message via ICQ to fishfreek Send a message via AIM to fishfreek Send a message via MSN to fishfreek Send a message via Yahoo to fishfreek
To use the command line interface to export the database to a CSV file try this.

[code:1:8dea7bc730]mysqldump -u (username) -p (password) -T (directory_to_place_output) --fields-terminated-by=',' (db_name) (table_name)[/code:1:8dea7bc730]
fishfreek is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
accept post data from form, process, then redirect data to another script gnznroses Coding Forum 4 09-29-2007 02:39 PM
PHP newbie-strip returns from data before sent to txt file loki Coding Forum 5 06-04-2004 02:41 AM
FormMail wbstein Coding Forum 12 05-19-2004 07:52 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 04:44 AM.
© Copyright 2008 V7 Inc