Académique Documents
Professionnel Documents
Culture Documents
Today we are going to use a .csv (comma seperated values) file to store values from an online PHP
web form.
A .csv file is a file that you can create easily with Microsoft Excel (further knowledge is beyond the
scope of this tutorial).
Okay, first off we will use the multi-purpose page technique from Build Database Driven Website
Using PHP and MySql.
We aren't using a database, we are going to use Excel in .csv form to store the form data.
Why http://adorablewinter120.shutterfly.com/adorablewinter120 do this when you can use a
database?
Data is portable
Data is readily readable by MS office
Data is web ready
Web hosting is simple, FTP and done.
Since my server location is offline, email me for the src code, sorry.
/tr
tr
td colspan="6"table width="100%" border="0" cellspacing="0" cellpadding="0"
tr
td width="71"Address/td
td width="721"input class="?=$aClass;?" name="address" type="text" id="address" size="100" //td
/tr
/table/td
/tr
tr
tdspanCity/span/td
tdinput class="?=$aClass;?" type="text" name="city" id="city" //td
tdspanState/span/td
td width="148"input class="?=$aClass;?" type="text" name="state" id="state" //td
td width="24"spanZIP/span/td
td width="255"input class="?=$aClass;?" type="text" name="zip" id="zip" //td
/tr
tr
tdspanPhone/span/td
tdinput class="?=$aClass;?" type="text" name="phone" id="phone" //td
tdspanEmail/span/td
tdinput class="?=$aClass;?" type="text" name="email" id="email" //td
tdinput name="emailMe" type="checkbox" id="emailMe" value="Yes" checked="checked" //td
tdPlease send me email/td
/tr
tr
td colspan="6"spanComments
textarea name="comments" id="comments" cols="45" rows="5"/textarea
/span
div align="center"
input type="submit" name="Submit" id="Submit" value="Submit" /
input type="reset" name="Reset" id="button" value="Reset" /
/div/td
/tr
/table
/form
Same deal, simple form, great results, you can use this technique using any type of form you
http://www.cityofkearney.org/jobs.aspx want, even one from my other articles.
Phone
Email
Yes/No
Comments
These headers will go across the first row and will match the variables in our PHP script to insert
them into the sheet.
http://alpho011.hubpages.com/hub/PHP-form-inserts-data-into-CSV-file