spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / php_forms2 / 1 To page 1To page 2current pageTo page 4
[previous] [next]

Managed Services Subject Matter Expert (PA)
Next Step Systems
US-PA-Wayne

Justtechjobs.com Post A Job | Post A Resume
Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies


How to Interact with Web Forms.. Part 2

Writing All Form Data into a File

After a user fills out a form correctly, what do you do with the form data? A very intuitive approach that does not require too much setup on the server is to write the data into a file on the server.

The preceding code contains a very naďve approach: All data is stored in a file on the server.When the form is submitted, the file is read in and unserialized into an array.Then, the form data is appended to the array. Finally, the array is serialized again and written back to the file.

Figure 4.3 shows this file in a text editor.

Sending All Form Data Via Email

A more imminent notification of someone filling out a form can be implemented by sending form data via email. Of course, you can write a custom mail script for each and every form; however, the preceding code shows how this can be done universally.Via for, all form data is merged into a string. Special care is taken of form values that are arrays—this can occur with multiple selection lists.Then the form data is mailed to the webmaster—just don’t forget to change the email address.

home / programming / php_forms2 / 1 To page 1To page 2current pageTo page 4
[previous] [next]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

Created: March 27, 2003
Revised: January 23, 2006

URL: http://webreference.com/programming/php_forms2/1