tarnold4 Posted March 3, 2015 Share Posted March 3, 2015 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 wonderfulLast 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) Quote Link to comment https://forums.phpfreaks.com/topic/295029-creating-submit-form-using-php/ Share on other sites More sharing options...
mac_gyver Posted March 3, 2015 Share Posted March 3, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/295029-creating-submit-form-using-php/#findComment-1507313 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.