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
https://forums.phpfreaks.com/topic/295029-creating-submit-form-using-php/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.