5, September 2008

Tutorial for newbies: Creating and manipulating web forms - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Design and Layout  >  General webmaster discussions (Moderator: Meth0d)
Topic: Tutorial for newbies: Creating and manipulating web forms
« previous next »
Pages: [1] Print

Author Topic: Tutorial for newbies: Creating and manipulating web forms  (Read 743 times)
aka J Love
Moderator
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« on: Dec 22, 2005, 06:09:59 AM »

Article written by Justin Love of J Love Web Design - www.justinlove.net Visit through proxy

How to create a web form similair to the ones we use on this website, with many more tricks and tips as you go along!

First, you should determine what type of script you are going to use to process your forms. I prefer Matt's FormMail script as the newer versions are quite secure, and the web forms are easy to manipulate. This script is written in CGI/PL and is available in the 'Downloads' section of our website. There are also many alternatives in the downloads section such as PHP form scripts amongst others.

If your server doesn't recognize PERL but does recognize CGI, then simply rename the formmail.pl file to formmail.cgi, and it will work the same. Next, you should upload the formmail.cgi file to your webserver in the "cgi-bin" directory if your host requires CGI scripts be placed there (J Love Web Hosting does require this). It is most likely that most other webhosts require this.

Now, you should begin writing the form itself. FormMail has many different possible attributes, but we are going to cover the main ones, how they are used, and how to implement them.

1. Start with:
Code:
<FORM METHOD="POST" ACTION="/CGI-BIN/FORMMAIL.CGI">
This will tell your form which script to use for processing.

2. Next, we want to tell the script where to send the mail, so we use this line of code:

Code:
<INPUT TYPE="HIDDEN" NAME="RECIPIENT" VALUE="YOU@YOUREMAIL.COM">
The fact that it is hidden makes it invisible on your browser, but it still performs the task.

3. Now we will pick a pre-determined subject for your form.

Code:
<INPUT TYPE="HIDDEN" NAME="SUBJECT" VALUE="My E-mail Form!">

4. Optionally, you can create a page which users will be re-directed to upon completion of your form.

Code:
<INPUT TYPE="HIDDEN" NAME="REDIRECT" VALUE"HTTP://URLTOTHANKYOUPAGE.COM">

5. You can also determine which fields should be required and which ones are optional. The variables in VALUE="" should be the same as those chosen below when you create the actual fields.

Code:
<INPUT TYPE="HIDDEN" NAME"REQUIRED" VALUE="NAME,EMAIL,COMMENTS">

6. As an option for step 5, you can also create a page users are redirected to if they leave a required field blank:

Code:
<INPUT TYPE="HIDDEN" NAME="MISSING_FIELDS_REDIRECT" VALUE="HTTP://URLTOMISSINGFIELDSPAGE.COM">

7. Now that we have set-up the pre-determined attributes for your form, we will create the necessary text-fields and buttons. For this example, we are creating 2 text boxes, a comment box, and 2 buttons. The size variable determines how long a text-box will be in characters.

Code:
<INPUT TYPE="TEXT" NAME="NAME" SIZE="25">
<INPUT TYPE="TEXT" NAME="EMAIL" SIZE="25">
<TEXTAREA NAME="COMMENTS" COLS="25" ROWS="5"></TEXTAREA>
<INPUT TYPE="SUBMIT" name="SUBMIT" value="Submit">
<INPUT TYPE="RESET" name="RESET" value="Clear">

8. Finally, we close the form with:

Code:
</FORM>
9. Help on customizing the appearance of a form with tables can be found in our 'Articles' section. We also provide scripting help on the Support Forum.
Article written by Justin Love of J Love Web Design - www.justinlove.net Visit through proxy

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #1 on: Dec 26, 2005, 05:42:37 AM »

Nice tutorial for beginners.

Matt's script can be located here Visit through proxy but as we are talking for beginners here, i would recommend to use a php form mail program.

Here is a great list of php form mail scripts :

http://php.resourceindex.com/Complete_Scripts/Form_Processing/ Visit through proxy

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
aka J Love
Moderator
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #2 on: Dec 26, 2005, 07:50:28 AM »

i used to use a php script for them, i like them better as well but i cant find a good one that will fit my layout on my site at justinlove.net now, so i use formmail. got any ideas?

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=1045
Tags : php tutorials email Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Design and Layout  >  General webmaster discussions (Moderator: Meth0d)
Topic: Tutorial for newbies: Creating and manipulating web forms
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 07:50:11 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.290
Total Topics: 7.476
Total Members: 3.897
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: FlorianHofmann

14 Guests, 3 Users online :

14 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.