- 1.5 hours on-demand video
- 2 articles
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Understand how to build and embed into their website a custom made contact form.
- To see how easy is to create contact from scratch.
- Gain skills to apply contact form to their website.
- Build multi-step form
- Add conditional fields to existing form
Here is how to set up your working environment using: Apache, PHP, MySql and phpmyadmin.You could then easily try the examples from the lectures.
We will structure the initial files and construct the Form with its specific form fields. We will start with using editor Sublime text to create our .php and .css. Then we will link those files and run them in a browser.
We will add code to process the information received from the contact form. We will use php's $_POST array to access the submitted information and will redisplay our form filled with information.
Note: If you would like to test on the php embedded web server, just go to your scripts directory and run: php -S 127.0.0.1:8000
We will make improvements to our code in order to become more readable and easy to maintain. We will continue exploring and extending our validate() function by removing some of the variables used, adding additional error and success messages and replacing the multiple functional return statements.
We will protect the form from several attacks using token and empty fields. Token protection is to ensure protection against scenario, where we visit an attacker website, specially designed to make request and submit our form, without our knowledge. This type of an attack is also known as cross-site-request-forgery. Empty field technique will stop bots from auto submitting the form.
note: For php version < 7 please use openssl_random_pseudo_bytes() function instead of random_bytes().
You can practice your skills using the source files. Just extract them to an executable folder of your web-server and open them in browser.
If you need the user submitted form information emailed, you can use the following code:
mail("firstname.lastname@example.org","Received form data",$msg);
- You should have access to your website files, and being able to edit them.
- basic HTML skills
What students say:
This course does assume some prior knowledge of PHP type programming, with the limited knowledge I have thus far, I find I can follow quite easily as well as learn new techniques. Instructor appears to be very knowledgeable about subject.
Although I could clearly see my lack of skill in php and css I was able to understand enough to execute the new information, given the platforms. The course delivered what it said it would.
The course was to-the-point without a bunch of rambling on about irrelevant and unrelated things. It was easy to follow along with the creation of the form from start to finish in all of the languages necessary (except the styles, maybe). The finished form is also available as a .zip so that you can explore the source code yourself if there is something you had trouble following in the video.
Please enjoy the course !
- Students who want to place contact form into their website with the help of PHP language.
- Students who want to learn how to create contact forms.