homepage Welcome to WebmasterWorld Guest from 54.145.209.80
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP Form Script
successfirst

5+ Year Member



 
Msg#: 11165 posted 7:36 pm on Dec 27, 2005 (gmt 0)

Hi, I need a php script written but I'm not sure what type of database I need and how many databases the script will require. I was wondering if anyone knows.

I need a script that does the following:

1. Has a few form fields (Full Name, Address, City... etc) and a few drop boxes.

2. When the form is submitted it writes the data into a xls file.

3. Every time the script is run a unique id (number) should be generated and written into the xls file together with the rest of the data.

4. Verifies that the telephone number matches the state when the form is submitted, otherwise it will return a error message.

5. Every time the form is submitted, it overwrites the existing xls file and combines the data in one file.

6. It saves the ip, date, time, and URL.

Regards,
Brandon

 

mm1220

10+ Year Member



 
Msg#: 11165 posted 8:32 pm on Dec 27, 2005 (gmt 0)

I don't think that a database is needed at all but rather careful use of PHP's file handling functions to manipulate the xls file.

successfirst

5+ Year Member



 
Msg#: 11165 posted 9:11 pm on Dec 27, 2005 (gmt 0)

The only reason I was thinking a database is needed is to store the xls file.

mm1220

10+ Year Member



 
Msg#: 11165 posted 12:22 am on Dec 28, 2005 (gmt 0)

Just store it like a regular file?

successfirst

5+ Year Member



 
Msg#: 11165 posted 12:42 am on Dec 28, 2005 (gmt 0)

So you think I could store it like a regular file, and the script can pull the file and update it when the form is filled out?

mm1220

10+ Year Member



 
Msg#: 11165 posted 12:26 pm on Dec 28, 2005 (gmt 0)

It may be quite messy to edit an xls file in that manner as opposed to editing a regular text file.

The alternative would be to use a database, not to store the xls file but to store the data which you could export to an xls file. I'm not 100% whether or not this is natively possible with MySQL but you can definitely export to HTML or XML quite easily.

successfirst

5+ Year Member



 
Msg#: 11165 posted 3:05 pm on Dec 28, 2005 (gmt 0)

Ok, thanks a lot!

slade7

10+ Year Member



 
Msg#: 11165 posted 10:30 pm on Dec 28, 2005 (gmt 0)

If you use mysql - it doesn't natively export AS xls, BUT, you can output whatever you like to html and then use Excel's import web data feature to import it to an excel file.

Once you set up the file, you can just refresh it when you want to load whatever new data might be there.

It's also a quick and dirty way to keep backup copies of your raw data for small tables (less than 65,536 rows or so)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved