As a learning curve with PHP, you have to create a basic form first when you are familiar with all basic PHP terminology. Refer to this YouTube video for a quick guide to basic PHP terminology.
Uploaded everything to GitHub https://github.com/pdilip84/BasicPHPForm
Now below are the steps in which we will design our form. Gradually we will make it advance.
- Create a simple form using Bootstrap 4 & JS validation. Keep form fields simple for now like User name, Email id, Password, and Confirm password. Index1. php in master branch.
- When the form is submitted Check for server-side validation & do variable sanitization. Index2.php in master branch
- Do password hash. Use the PDO class to connect with the Mysqli database and complete a simple insert task. index3.php in master branch.
- Now Display your table on the same page. index4.php in master branch
- Do edit & delete from the table link index5.php in master branch
- Now Add some advanced fields like Gender (Male/Female as radio), User type (admin/guest) dropdown, Comments/Messages (Textarea), Profile image (Image upload), Country (List using API call) dropdown & City based on API calls with Ajax. Ohh… That’s enough for now đŸ™‚
- Once you managed this, Bingooo! You are good to go ahead. Replace your table with a data table where you can filter data, order data, and much more.
- use sweet alerts to display messages.
- Finally, modify the form in such a way that deletes data call Ajax request to your data, and without page loading your data table will be updated.