creating html forms can be a rather long procedure if you are using plain html on the frond-end

How it works

the code is very simple, I first created two arrays, one storing values for the field labels and the other holding values for the field names and the creating a foreach loop. in the foreach loops I echo firstly the label and then the field. the array structures for labels would look something like: $labels = array('firstname' => 'First_Name', 'lastname' => 'Last_Name');

so basically I print out each value in the labels array and do the same for the field name array

from there the values are passed from the form to the processor script/ the action script where the values are validated and can be printed out or stored in a database or something! instead of using the $_POST method for every value I used foreach:

i.e foreach ($_POST as $field => $value){ }

the processing script took about 3 lines and could have easily taken over 10 if say you have a form of +10 fields

Challenges I ran into

Accomplishments that I'm proud of

im a back-end guy so im very happy to say that ive just made the job a lot easier for the front-end guy

What I learned

ive learnt how to effectively use php in html form processing

What's next for Easy Php form

using OOP to process forms

Built With

Share this project: