6 | The Basics of PHP Form Handling Tutorial | 2023 | Learn PHP Full Course for Beginners

  Рет қаралды 81,188

Dani Krossing

Dani Krossing

Жыл бұрын

The basics of PHP form validation is something that is important when learning PHP, and in this tutorial I will show you what you need to get started on the basics of PHP form handling. 🙂
HTML Form tutorial: • 28 | HOW TO CREATE & S...
Documentation:
www.php.net/manual/en/tutoria...
www.php.net/manual/en/functio...
www.php.net/manual/en/functio...
www.w3schools.com/html/html_e...
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon and KZbin Memberships to share improved and updated lesson material, and for a small fee you can access all the material either from my memberships or Patreon, depending on your preference. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful :)
Memberships: / @dani_krossing
Patreon: / mmtuts

Пікірлер: 129
@Dani_Krossing
@Dani_Krossing Жыл бұрын
A CORRECTION TO THIS VIDEO! In the part where I create the exit() function, you need to make sure you place it AFTER the header() function! Otherwise the script is obviously exited before it even runs the header() function. 😂 Me dum dum me see rock smash smash hehe 😂
@Dani_Krossing
@Dani_Krossing Жыл бұрын
@@mehdimerimi5067 The source code is linked in the description for members 🙂
@ShootYourBricks
@ShootYourBricks Жыл бұрын
I was wondering how that worked😂
@Dani_Krossing
@Dani_Krossing Жыл бұрын
@Mehdi MERIMI Ah hehe no problem. 😊 I have trouble recognizing sarcasm, and when I also once in a while do get people who wanna "fight me about it" and are actually upset about it, I can be quick to defend my usage of memberships for my files hehe. No hard feelings. 😊
@cruzinsweetsntreats
@cruzinsweetsntreats Жыл бұрын
I was getting the auto check squiggly lines under the location redirect, unlike yourself at 23:16 for the empty value check. Once I figured that out, then saw your response here. 😁 04-16-2023 0404 PT "404 ERROR CODE" 🧐😎🤣
@danielbuleandra3981
@danielbuleandra3981 6 ай бұрын
well reading this comment would have spared me 3-5 hours of staring into the monitor....just put a pop up comment in the video so other wont burnout trying to figure out
@Phil-nc5mw
@Phil-nc5mw 23 күн бұрын
Dude the fact you made an entire course for free is amazing. Thank you so much. I wasted so much money on expensive courses for different languages not realizing I could have just been watching your videos instead.
@fissionchips223
@fissionchips223 8 ай бұрын
Another fantastic installment, Dani! While these are getting a little more complex, simply watching a second time makes all the difference. Thanks again for your tremendously helpful tutorials - I am having the best time learning this!
@kevinerose
@kevinerose 8 ай бұрын
Great videos! I am enjoying your format of training. I haven't programmed in 20 years and surprised to see PHP is still popular. Back then we had PHP and ASP (active server pages). Although I left programming before getting too deep into all that. My boss sent me to ASP training but we never really got very far with web development where I was working although they wanted to.
@cloudagnostic
@cloudagnostic Жыл бұрын
Great tutorial! I started learning PHP 5 years ago and switched to javascript (nodejs). I always found php much easier and occasionally I do small projects with the language. I might make the switch back after this series!😅
@nedalturas
@nedalturas 7 ай бұрын
Been looking for some PHP tutorials as I need to re learn it, your video is very detailed and I love it.
@George83636
@George83636 5 ай бұрын
Again great material. A talent in explaining things simply!
@kibuzz3258
@kibuzz3258 9 ай бұрын
wonderful tutorial, i found it very usefull. Thank u a lot, keep going!!!
@IamtheActionman
@IamtheActionman 7 ай бұрын
Excellent
@k.ashutoshbaitharu3964
@k.ashutoshbaitharu3964 6 ай бұрын
I like how you explain stuff in detail.
@kehindedeborah8901
@kehindedeborah8901 6 ай бұрын
i am glad i come across your tutorials
@ismiputri-5209
@ismiputri-5209 11 ай бұрын
Nice explanation, not only tutorial but the reason why we use code in certain way. Thank you, Dani.
@remasrebas3776
@remasrebas3776 5 ай бұрын
I'm starting to love php because of you!
@user-fg3fm2mt3g
@user-fg3fm2mt3g 11 ай бұрын
Your explanation, I bet you understand it explicitly well. Great video Dani.
@danielolivera2618
@danielolivera2618 5 ай бұрын
just found your video. thank you so much, as far as over explaining keep doing it because if you wouldn't have done it i would be lost. THANK YOU!!!
@sheikharooj5762
@sheikharooj5762 2 ай бұрын
Simply extraordinary.. Loved it❤
@sonamohialdin3376
@sonamohialdin3376 Жыл бұрын
This tutorial is very helpful thank you
@moraaoo4889
@moraaoo4889 6 ай бұрын
Everything is simple with Dani, thanks a lot ❤
@mungukendejoshua3632
@mungukendejoshua3632 6 ай бұрын
u are the man.. much love from Uganda
@surangkanangkiangkitiwan4200
@surangkanangkiangkitiwan4200 21 күн бұрын
I just wanted to say a huge thank you for offering this fantastic free course! I've tried learning programming from different places, but your way of explaining things simply is truly amazing. I'm incredibly thankful! 🙏
@kavinj4455
@kavinj4455 11 ай бұрын
Thank you ! this is super helpful !
@DevinGeegh
@DevinGeegh 8 ай бұрын
I love your video!!! I am curious how to throw up an error message on the index page after the exit? Also you mentioned some things after the htmlspecialchars that could be added, curious on that as well. Maybe you cover this in a later video that I haven't been through yet. Anyways... Keep up the awsome work! Thanks!
@infinity_ahashara
@infinity_ahashara 2 ай бұрын
you explaining very well !
@kerrywsmyth
@kerrywsmyth Жыл бұрын
Liked all and subscribed. Please keep them coming
@ryyyyy2010
@ryyyyy2010 7 ай бұрын
Tysm bro, very useful and informative for a beginner like me.
@gertjansluimer6078
@gertjansluimer6078 6 ай бұрын
This is better than most schools
@Boylagak
@Boylagak 6 ай бұрын
Thank you sir Dani!❤
@user-jo2sn3rz8r
@user-jo2sn3rz8r 9 күн бұрын
Thanks bro, your tutorial is simple, straight and simple ❤
@priyadharshinimuthukumar8970
@priyadharshinimuthukumar8970 4 ай бұрын
thanks for giving such a good understandable concept when implementing php codes
@sundayemmanuel4789
@sundayemmanuel4789 4 ай бұрын
Thanks man!
@utkarshsrivastava5461
@utkarshsrivastava5461 7 ай бұрын
Thanx Daniel
@mohammedshawket6005
@mohammedshawket6005 Жыл бұрын
i have taken many courses, but sir you are the best
@jesuopin1612
@jesuopin1612 Жыл бұрын
Love this playlist! half an hour long videos and not very long playlist. I might have finished this playlist in less than 1 day and i can already start writting some small php scripts :D
@Dani_Krossing
@Dani_Krossing Жыл бұрын
I'm glad you enjoy the videos 😊
@makispariva1651
@makispariva1651 5 ай бұрын
Thanks so much for all the deep and at the same time easy explanations! PHP was frustating me so much until I found your videos =)
@Toussaintiradukunda
@Toussaintiradukunda Жыл бұрын
helpful video thank you so much🤩🤩🤩🤩🤩
@benjicanones1454
@benjicanones1454 10 ай бұрын
Thank you!
@abdelrahmanabdallah6308
@abdelrahmanabdallah6308 Ай бұрын
Thanks Dani! ❤
@sirsebastian2026
@sirsebastian2026 4 ай бұрын
Thank you so much!
@akashgola2153
@akashgola2153 Ай бұрын
Got the points, Got the Correction. 10/10. Also subscribed.
@koushikshil6037
@koushikshil6037 Ай бұрын
Thanks, bro
@allestercorton9085
@allestercorton9085 10 ай бұрын
Wow, that's very helpful.
@Dani_Krossing
@Dani_Krossing 10 ай бұрын
Glad you think so!
@michaelbica9294
@michaelbica9294 Жыл бұрын
Hi Daniel, thank you for doing this php tutorials.🍻✌
@Dani_Krossing
@Dani_Krossing Жыл бұрын
You are so welcome Michael. 🙂
@techmillennium6332
@techmillennium6332 11 ай бұрын
Your way of teaching is great sir. But another thing I want to say sir, u looks like Elon Musk .
@RAHAT_PY
@RAHAT_PY Жыл бұрын
This tutorial is very helpful thank you but one thing plz upload it daily
@lordtop6847
@lordtop6847 2 ай бұрын
Thank you for the video, but I have a problem after submitting on the initial php page on localhost with html, which causes an error in the console log on the same page: "Not allowed to load local resource: ". How did you get the final result without errors popping up?
@estudiar173
@estudiar173 11 ай бұрын
thanks
@sakmaestro3852
@sakmaestro3852 7 ай бұрын
Great...... do u have udemy course in php?
@RAHAT_PY
@RAHAT_PY Жыл бұрын
and thanks 😀
@ramanmhedin1137
@ramanmhedin1137 Жыл бұрын
thank you for these tutorials,will you use AJAX with PHP and MySQL in the next videos?
@Dani_Krossing
@Dani_Krossing Жыл бұрын
Later in this course we will get into MySQL yes. 🙂 AJAX I think however belong in a separate course, since it is mostly JavaScript.
@mandy1784
@mandy1784 3 ай бұрын
is that security issue still true for frontend frameworks like React or Vue? Thanks for the vid!
@alynn.art.studio
@alynn.art.studio Ай бұрын
14:06 ahhh! This is why some sites break your commas and ampersands!
@yomegram6721
@yomegram6721 9 ай бұрын
/* this champ should be getting way more likes for his efforts. Big up champ*/
@Dani_Krossing
@Dani_Krossing 9 ай бұрын
Thank you ☺
@amiramohammed1568
@amiramohammed1568 5 ай бұрын
👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽
@Izkawi33
@Izkawi33 10 ай бұрын
thank you Dani. is htmlspecialchars function used with string inputs what about if data submitted of type integer or float or boolean should I put htmlspecialchars??
@Dani_Krossing
@Dani_Krossing 10 ай бұрын
You can use htmlspecialchars() for that too yes, however we do also have more specific sanitization functions you can use for non-string data. Such as filter_var or filter_input.
@Websitecorner
@Websitecorner 4 ай бұрын
hi, thanks for the video , I have a question , when I save the file as PHP, auto closing tags doesn't work anymore , it works fine in html files but not in php ! do you have any idea? thanks
@krishnashrestha6040
@krishnashrestha6040 Ай бұрын
One of the best tutorial. And bro looks like Elon😅
@_ChildofYeshua_
@_ChildofYeshua_ 5 ай бұрын
Send to same form = Action = "name of that same form" So if your form is on the index.php form then just call that form action="index.php" without including the super global. If you're gona use the super global then make sure to sanitize it i.e strip_tags, stripshlashes, trim, html entities etc...
@misstallschannel7983
@misstallschannel7983 3 ай бұрын
Thank you so much for this comment, Yoh you helped me 😢, I have been here for hours, I was about to give up 🥹
@Daniel_Wray
@Daniel_Wray Ай бұрын
Great video... I've gone wrong somewhere though. I only have the select option for 'Favourite pet' and no text box to type any other information in for Firstname and Lastname. Where did I go wrong?
@emmanuelameyaw5686
@emmanuelameyaw5686 7 ай бұрын
Hee taught HTML and PHP together
@krazy_kzir
@krazy_kzir 3 ай бұрын
Hey i have a nasty error "unreachable code" when working on if statement on empty data input.
@wplearntv
@wplearntv 6 ай бұрын
Please make a video on how to create new project with backend and frontend that have admin control
@user-ih2zp9jg7f
@user-ih2zp9jg7f 3 ай бұрын
Good afternoon, Dani. Thanks for all your tutorials. Question: I feel that I have to choose between Javascript and PHP. For front-end coding and eventually also for back-end coding. What do you say, Javascript or PHP? Greetings, Ruud (Amsterdam, Holland)
@Dani_Krossing
@Dani_Krossing 3 ай бұрын
Hi. I'm a bit confused by the question. You say you need to learn a front-end and a back-end language? Then it makes sense to learn both, seeing JavaScript is front-end, and PHP is back-end. 🙂 JavaScript CAN be learned as a back-end language as well, if done so through frameworks like Node.js... But PHP is still vastly more popular as a backend choice.
@user-ih2zp9jg7f
@user-ih2zp9jg7f 3 ай бұрын
Thank you.
@user-mf4pv3rm2e
@user-mf4pv3rm2e Жыл бұрын
More of security videos about PHP
@adtronadebawo7647
@adtronadebawo7647 11 ай бұрын
Great video, thanks Dani. But on the handler page after it loads, if you fresh it will throw an error of "undifiend array", how do we handle this?
@Dani_Krossing
@Dani_Krossing 11 ай бұрын
What is the exact error message you get? Are you sure it's not "undefined variable"? Because I don't believe we ever used an array in this video. 🙂
@adtronadebawo7647
@adtronadebawo7647 11 ай бұрын
@@Dani_Krossing Yes, it's undefined variables, that was a typo error. Thanks 🙏
@MohammedAlziko
@MohammedAlziko 4 ай бұрын
😘😘😘
@basiccode8889
@basiccode8889 Жыл бұрын
More videos pls
@Stoney_Eagle
@Stoney_Eagle Жыл бұрын
Yup, never trust the user and never trust the client.
@Elumalai1991
@Elumalai1991 9 ай бұрын
this programe form handling insert programme but not ouput what happened i dont know pls what r the reason tell me this programme second programme
@xiaoanlao8420
@xiaoanlao8420 6 ай бұрын
Hope that you will have Udemy course for PHP
@Dani_Krossing
@Dani_Krossing 6 ай бұрын
Everything I make is free on KZbin 🙂
@ShootYourBricks
@ShootYourBricks Жыл бұрын
If I have a page with php and html, is it still good to omit the end ?> tag as long as there's no html at the end?
@Dani_Krossing
@Dani_Krossing Жыл бұрын
Omitting the closing tag should only be done in "code only files". So if you have a document that acts as a "page" inside your website, then you should include the closing tag.
@acitbambili7759
@acitbambili7759 3 ай бұрын
Nice video, thanks for the efforts, God will contiue to bless you. Please, Dani i have a problem in chapter 6, about PHP Form Handling. This code snippet you gave: if(empty($_POST['name'])) { exit(); header("Location: ../index.php"); } I think the header line will be unreachablbe or I am missing something. The exit() function is exiting what, the if statement or the page?
@Dani_Krossing
@Dani_Krossing 3 ай бұрын
Swap the exit and header functions around 🙂
@brianjett1446
@brianjett1446 5 ай бұрын
Can you please make a php payment form??!!!
@ghcybertech
@ghcybertech Жыл бұрын
i love you
@RAHAT_PY
@RAHAT_PY Жыл бұрын
Bro I don't have money; so I don't buy any update course Plz upload it daily.
@user-yx1hq8qy8g
@user-yx1hq8qy8g Ай бұрын
sorry how to sumitt form in the localhost in tutorial 6
@GoodBoy-zc3ol
@GoodBoy-zc3ol 2 ай бұрын
the header() funtion doesnt seem to work when i tried it, like the code is not even there. what is wrong
@GoodBoy-zc3ol
@GoodBoy-zc3ol 2 ай бұрын
solved it, i think i typed coma instead of dot. all i did was retype it
@s2003katalin
@s2003katalin 11 ай бұрын
Please use die(); after header();
@Dani_Krossing
@Dani_Krossing 11 ай бұрын
Yes very good point, I included that in a pinned comment right after I uploaded this video. 🙂 Otherwise a few things can go wrong, one for example being that the form gets resubmitted on refresh. Exit() is also a valid function to use. Most people use Die() when you need to stop the script because of an error, and Exit() whenever everything went as expected. The main difference between the two is that one closes the HTTP connection, and the other one doesn’t.
@labo6813
@labo6813 9 ай бұрын
please where is the main.css code to the 6th video on forms??
@Dani_Krossing
@Dani_Krossing 9 ай бұрын
In the bottom of the description, is a link to all my available lesson material. 🙂
@yuxomgaming9824
@yuxomgaming9824 5 ай бұрын
U lowkey look like Mr. beast
@user-yx1hq8qy8g
@user-yx1hq8qy8g Ай бұрын
sorry sir I need to explain the first of tutorial 6 I can't understand
@kylehawks2966
@kylehawks2966 10 ай бұрын
10 hours just trying to get past 11min mark on you video I do no Know what I'm doing wrong went to other channell to figure out xamp, got another editor I dk
@Dani_Krossing
@Dani_Krossing 10 ай бұрын
It helps if you describe the issue you are having? 🙂 Otherwise I don't have any info to help you pinpoint the issue. First of all, did you follow my video series from the start? If not, then it might explain why you are getting errors.
@heinzerbrew
@heinzerbrew 2 ай бұрын
ouch, white screen in dark mode. 🤣
@ChrisWalker-pd2xn
@ChrisWalker-pd2xn 6 ай бұрын
7:18 thank me later
@Dani_Krossing
@Dani_Krossing 6 ай бұрын
Some might enjoy a refresher on how HTML interacts with PHP, but yes, that is the time stamp for skipping the HTML part 🙂
@darubramasto
@darubramasto 6 ай бұрын
you don’t need to write every variables corresponding every attribute passed. Just write $data[‘foo’] = ‘name’; $data[‘foo2’] = ‘name2’; and echo $data; or compact(‘data’);
@anikhasan6467
@anikhasan6467 Жыл бұрын
Its been 6 day's 😢
@Dani_Krossing
@Dani_Krossing Жыл бұрын
Have been quite busy this week, and won't make it into the office until after the weekend unfortunately. 😅 But will be right back posting then 😉
@tanzimwalweni6569
@tanzimwalweni6569 7 ай бұрын
Stop talking about html please, youre confusing the beginners php learners
@Dani_Krossing
@Dani_Krossing 7 ай бұрын
HTML is a part of PHP. You should know HTML before getting into PHP, since many PHP features require HTML to work. So if you don't know HTML, I wouldn't recommend jumping ahead to PHP. I will be talking a lot more about HTML in these videos ahead, since it is necessary.
@coolvibesreloaded7946
@coolvibesreloaded7946 3 ай бұрын
@Dani_Krossing is this form to email as well
@user-yx1hq8qy8g
@user-yx1hq8qy8g Ай бұрын
how
Learn PHP in 15 minutes
15:00
Jake Wright
Рет қаралды 2,7 МЛН
real magnetic face mask
00:34
승비니 Seungbini
Рет қаралды 32 МЛН
Money Vs Knowledge , Help Victor🤑😢
00:28
FANTOM Pro
Рет қаралды 192 МЛН
ISSEI funny story 😂😂😂Strange World 🌏 Green
00:27
ISSEI / いっせい
Рет қаралды 61 МЛН
Габаны сындырамыз | Synyptas 3 | 5 серия
21:40
kak budto
Рет қаралды 1,4 МЛН
Learn HTML forms in 8 minutes 📝
8:39
Bro Code
Рет қаралды 261 М.
PHP in 100 Seconds
2:21
Fireship
Рет қаралды 1,2 МЛН
Learn HTML Forms In 25 Minutes
24:56
Web Dev Simplified
Рет қаралды 939 М.
real magnetic face mask
00:34
승비니 Seungbini
Рет қаралды 32 МЛН