Jump to content

creating submit form using php


tarnold4

Recommended Posts

I am trying my shot at creating a webpage by myself and I wanna create a submit form, with a submit button. I want all the information below to be in the submit form.... Help would be wonderful

Last Name (last, text)
First Name (first, text)
Street Address 1 (street1, text)
Street Address 2 (street2, text)
City (city, text)
State  (state, text)
Zip (zip, text)
Phone (phone, text)
Fax (fax, text)
Email (email, text)
Verify Email (verify_email, text)
How did you find us? (marketing, select)
                                1.  Mailing
                                2.  Phonebook
                                3. Search Engine
                                 4. Phone Call
                                5. Word of mouth
                               6.  Other
    Type of request (request_type, radio)
    Quote
    Information Request
    Quote/Request (request, textarea)
 

Link to comment
Share on other sites

i recommend creating an array that holds your form definition (the display/legend text, field type, field name, and validation type information), then loop over this defining array, to produce the html of the form, and use the array data when processing and validating the submitted form data. here is a recent thread showing the basic layout of a form/form processing code - http://forums.phpfreaks.com/topic/294898-required-fields/?do=findComment&comment=1506734 my suggestion of using this defining array would be in addition that what is shown in that thread and would replace the writing out of the html for the form fields and the writing out of the validation logic for each form field with code making use of the array data instead to control what happens.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.