How To Create a Contact Form | PHP Programming Tutorial Video

preview_player
Показать описание
In this video, we are going to create a simple contact form. You can see here at the moment we just got to text fields and a text area the idea here is these are filled out the form, click Submit, and this is sent through to an email address with the relevant data.


let's go ahead and type in my name, is hoping a valid email address, now this form field here will be invalidated so the user will have to provide a valid email address and also message as well, we go ahead and click on Submit, has been submitted we've got this confirmation message thanks for contacting us an important point here is that we can't then go ahead and refresh the page to resend it because essentially seeing this sent variable hear, about that in a moment they have now received an email from Alex from PHP academy he can we talk which is the email address that we supplied and we've also got the message in here, now the good thing about this is we've supplied the email address that's been provided and we've put this into the From field so we can basically hit reply and this will then send us back to the email address that the user has provided. So essentially just a really quick way to get a contact form submission sent you an email address and then the ability to go ahead and reply email directly. so that's basically it let's just quickly take a look at what happens when we don't enter anything which is here we have a message here so error message that the name email messages are required to let's go ahead and fill the end but just so Alex in the email field for example and then just hello in here when I click Submit we get that validate email address so we validating this field here many other good thing about this is that you noticed that these form fields have retained their values we've refresh the page but we haven't actually got rid of these values which browsers will do by the fall so we're keeping these values as well so we'll be discussing all these points and creating a basic contact form so in the next part will be starting to write the mark-up and then we'll look at some PHP code.

➡️ About Full Stack Java Developer Masters Program
This Java Full Stack Developer course is designed to introduce you to front-end, middleware, and back-end Java web developement technologies. You will learn to build an end-to-end application, test and deploy code, store data using MongoDB, and much more.

✅ Key Features
- Simplilearn's JobAssist helps you get noticed by top hiring companies
- Kickstart Full Stack Java Developer career with industry-aligned curriculum by experts
- Hands-on practice through 20+ projects, assessments, and tests
- Learn cutting edge frameworks like React, Springboot, and many more
- Live interaction and applied learning with industry expert trainers
- Practice hands - on learning with Capstone Projects across 4 domains

✅ Skills Covered
- Agile
- Git
- SQL
- Core Java
- Spring
- Spring Boot
- HTML and CSS
- AWS
- Docker
- Jenkins
- JavaScript
- ReactJS
- Cucumber
- Maven JSP
- JDBC
- MongoDB
- JUnit

Рекомендации по теме
Комментарии
Автор

very nice and clean tutorial!!! What about security?

goffredo
Автор

thank you dude it's help me a lot keep up the good work.

sandrojimena
Автор

THANK YOU SO MUCH you help me alot, actually you save my life :) thank you really really.

lykarosenavarro
Автор

Please make an complete course on Backend development.

amazingproducts-sahilview
Автор

Great job man! Really appreciate this.

patryk
Автор

Your voice sounds like Benji from mission: impossible
That's nice

xristosbart
Автор

Thanks again buddy! Great tutorial as always!

autopilot
Автор

Hi i want to ask how is called the video for configuring apache and php .
Thanks for the video it was great !

tukiukick
Автор

Great tutorial! Is there a download link for the form?

Razvanh
Автор

This is one of the better tutorials. Unfortunately its very blurry and its very hard to view some of he smaller characters. Are there download files to check the code?

billketchersid
Автор

Great tutorial, thank you! Has anyone received an answer to your questions about not receiving emails? I have the same problem, everything seems to be working perfect, but the email is not coming...

andixhali
Автор

Where is the tutorial on linking the email? Thank you! Great tutorial!

lindseynorberg
Автор

I feel like you could do some of the form validation checking in JavaScript so it could update as the user types in the inputs, in real time.

isaiahkahler
Автор

Whenever I refresh the page it wants to submit the form again, I did some online research and people mentioned to use post/redirect/get method. However I didn't see you run into this problem at all?

dinosawergweaver
Автор

Hey I am trying to code a simple contact form like the one in your video but the message doesn't seem to be sending. Someone saw my code and said the reason it is not sending is because there is no smtp server name, password, port number and username. In all of the tutorials i have watch i have never seen an instructor enter those info in there code and there messages send with success can you please explain why. I am a very confused newbie.

morecheddaa
Автор

nicely explained and very helpful for learning php, but when i tried this, i got no errors and the message that the message was sent, but i don't receive it in my inbox. Any help guys?

FGOD-
Автор

This is a wonderful video and my form works perfectly... except for one thing. One of the form fields is "Name" and I would like to get the name as well as the subject, email and message. I've tried adding $firstname to the 'mail' area, but then the form won't send. Would appreciate your input on this. Thanks!

heartspassionacademy
Автор

I did exactly what you did but i don't receive an email when i submit the contactform.. Please help

DeElfdeVinger
Автор

Awesome video!
Just some questions: how do I upload this correctly to my ftp root directory/webhost so that it works correct?
So I can actually have everything in one file ? should I then name it .php? I tried something similar but I had to have a index.php to my form.php. Didn't work naturally got the WSOD

stoffer
Автор

It is showing my code in the browser i have index.php and everything is correct. Any help?

jakecollier