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 😂
@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. 😊
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" 🧐😎🤣
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
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.
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! 🙏
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!😅
Very helpful. I hesitated getting into PHP since there's so much hate directed towards it, but so far it seems to be sane. Thanks for covering the security issues.
Yeah the hate for PHP is mostly VERY misguided hehe. People either hate it because: 1. It is an extremely easy language to learn, so there is a lot of "bad unsecure" code out there, written by beginners. 2. People still think that PHP is as bad as it was back in version 5 (which it is NOT anymore). 3. People will claim that "Python is better", when in actuality you learn PHP and Python for different reasons... I always roll my eyes when people bring up Python as "the only correct choice". 4. PHP can appear messy, since it is such a loosely typed language. So even if "the code works", it might not be pretty code. 5. And lastly, and most stupidly... People will say that "PHP is dying"... Just because "they heard some biased person say it was". 😅 When actually, PHP is only getting stronger. Honestly, only point 4 is a valid reason for people disliking PHP in my opinion. 🙂
@@Dani_Krossing I appreciate the breakdown, that explains a lot. Thank you for these videos! I'm enjoying working with PHP much more than my experience with Django so far.
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.
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!
Hi. The user can change the required option in the frontend via inspect based on your permission in the file manager. Using Chmod 644 for files and 755 for folders will not allow the users change the required option via inspect. Awesome tutorial by the way.
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...
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
Very nice series so far. Enjoying it a lot. Perhaps a stylistic preference I would like to point out is that at the end of the if statement you have the header function, then an else block and another header pointing to the same address. It might be easier not to have an else statement and just move the header function below the if statement. If the user makes a post request the header function is evaluated after the if statement and if the user does not make a post request the if statement is skipped and the header function is executed. What do you think?
The headers are for sending the user back, with a specific message in the URL. 🙂 Either a success message, or a specific error message. So they would need to be at the end of each statement. But you are right, because I didn’t actually add the error messages inside the various headers, so as they were left at the end of the video, they are duplicates. So a final last step is to add the error messages. 🙂👍
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!
Thank you. I never thought I would be taught how to create an HTML form by Elon Musk. I think this guy can impersonate him easily. Even his voice is similar :)
hi could you please show the css sheet how you styled this form, im struggle to get every thing alignd and center, i would like to see how you did all that. thank you.
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??
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.
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?
This is irrelevant but you look like Elon Musk and Mr Beast combined. Thanks for the guides though! I just started learning about PHP so hopefully all goes well.
“required” is just there to give a visual indicator. 🙂 You’ll even notice that even though it is supposed to prevent the form from being submitted, if you spam the submit button fast enough, it will still occasionally submit the form… So security wise, “required” is pointless in itself. So if you feel that you wanna add it in, go ahead. 🙂 It is an easy and fast way to notify a user, if they forgot to fill in an input. Just know that it is ONLY a visual indicator.
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
Both do something completely different, and it is common to see people use isset() for submits like these, which is considered a "beginner habbit". 🙂 (I have made the mistake of using it too). So essentially... isset($_POST['submit']) checks if a HTML submit field has been passed, and server[REQUEST_METHOD] checks if the form is submitted via the POST method. When do you use which? 👇 Use isset($_POST['submit']) when you want to verify if a specific form was submitted and processed (since different forms might have different submit buttons). Use $_SERVER['REQUEST_METHOD'] when you want to detect whether a form was submitted using a particular HTTP method (POST or GET) and it doesn’t depend on any specific form field. Or explained in simpler terms... So use $_SERVER[''] to check if a form has been properly submitted using a specific HTTP method like GET or POST, and use isset() to check if a SPECIFIC form on your website has been submitted. 🙂 You can of course use both, to create even better form submission handling. 👍
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)
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.
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?
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 😂
@@mehdimerimi5067 The source code is linked in the description for members 🙂
I was wondering how that worked😂
@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. 😊
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" 🧐😎🤣
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
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.
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! 🙏
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!😅
What a blessing to find your course, THANKS!!!!!
that is very useful! I took one PHP course before, but it never mentioned little things like this... glad I have found your course.
This is better than most schools
I like how you explain stuff in detail.
Very helpful. I hesitated getting into PHP since there's so much hate directed towards it, but so far it seems to be sane. Thanks for covering the security issues.
Yeah the hate for PHP is mostly VERY misguided hehe. People either hate it because:
1. It is an extremely easy language to learn, so there is a lot of "bad unsecure" code out there, written by beginners.
2. People still think that PHP is as bad as it was back in version 5 (which it is NOT anymore).
3. People will claim that "Python is better", when in actuality you learn PHP and Python for different reasons... I always roll my eyes when people bring up Python as "the only correct choice".
4. PHP can appear messy, since it is such a loosely typed language. So even if "the code works", it might not be pretty code.
5. And lastly, and most stupidly... People will say that "PHP is dying"... Just because "they heard some biased person say it was". 😅 When actually, PHP is only getting stronger.
Honestly, only point 4 is a valid reason for people disliking PHP in my opinion. 🙂
@@Dani_Krossing I appreciate the breakdown, that explains a lot. Thank you for these videos! I'm enjoying working with PHP much more than my experience with Django so far.
14:06 ahhh! This is why some sites break your commas and ampersands!
Thanks for these tutorials Dani 😊😊they are super easy to understand and remember
This was a nice explanation on why to error handle using php. loved it
i am glad i come across your tutorials
love this!! very informative!! thank you
I love how he enfatizes on security manners, great course!
Been looking for some PHP tutorials as I need to re learn it, your video is very detailed and I love it.
I'm starting to love php because of you!
Thank you so much well explained
Again great material. A talent in explaining things simply!
wonderful tutorial, i found it very usefull. Thank u a lot, keep going!!!
u are the man.. much love from Uganda
Everything is simple with Dani, thanks a lot ❤
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.
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!
Awesome. I really love how you go 360 about everything, including security rules of thumb. I love it !
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!!!
Nice explanation, not only tutorial but the reason why we use code in certain way. Thank you, Dani.
Thanks bro, your tutorial is simple, straight and simple ❤
thanks for giving such a good understandable concept when implementing php codes
error handling is very important. sanitizing too. we always cleared or initialized data before exits. but that was in C.
/* this champ should be getting way more likes for his efforts. Big up champ*/
Thank you ☺
Your way of teaching is great sir. But another thing I want to say sir, u looks like Elon Musk .
Exactly! did you noticed that 😂😂
Tysm bro, very useful and informative for a beginner like me.
i have taken many courses, but sir you are the best
Your explanation, I bet you understand it explicitly well.
Great video Dani.
Hi.
The user can change the required option in the frontend via inspect based on your permission in the file manager.
Using Chmod 644 for files and 755 for folders will not allow the users change the required option via inspect.
Awesome tutorial by the way.
Wow, that's very helpful.
Glad you think so!
Thanks for your content is amazing
Simply extraordinary.. Loved it❤
Got the points, Got the Correction. 10/10. Also subscribed.
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...
Thank you so much for this comment, Yoh you helped me 😢, I have been here for hours, I was about to give up 🥹
Thank you!
Beautiful video
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
I'm glad you enjoy the videos 😊
This tutorial is very helpful thank you
Thanks Daniel
funny how i understand this in my room in a few minutes than in class a whole semester
thank you so much.
Thank you ! this is super helpful !
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 =)
helpful video thank you so much🤩🤩🤩🤩🤩
Thanks man!
Nice
Thanks Dani! ❤
Thank you so much!
Thanx Daniel
Hi Daniel, thank you for doing this php tutorials.🍻✌
You are so welcome Michael. 🙂
Very nice series so far. Enjoying it a lot. Perhaps a stylistic preference I would like to point out is that at the end of the if statement you have the header function, then an else block and another header pointing to the same address. It might be easier not to have an else statement and just move the header function below the if statement. If the user makes a post request the header function is evaluated after the if statement and if the user does not make a post request the if statement is skipped and the header function is executed. What do you think?
The headers are for sending the user back, with a specific message in the URL. 🙂 Either a success message, or a specific error message. So they would need to be at the end of each statement.
But you are right, because I didn’t actually add the error messages inside the various headers, so as they were left at the end of the video, they are duplicates. So a final last step is to add the error messages. 🙂👍
Thank you sir
Thank you sir Dani!❤
Liked all and subscribed. Please keep them coming
Thanks for you
Excellent
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!
is that security issue still true for frontend frameworks like React or Vue? Thanks for the vid!
Thank you. I never thought I would be taught how to create an HTML form by Elon Musk. I think this guy can impersonate him easily. Even his voice is similar :)
💯💯fr, i hadn't even realised😅
thank you for these tutorials,will you use AJAX with PHP and MySQL in the next videos?
Later in this course we will get into MySQL yes. 🙂 AJAX I think however belong in a separate course, since it is mostly JavaScript.
Thanks, bro
hi could you please show the css sheet how you styled this form, im struggle to get every thing alignd and center, i would like to see how you did all that. thank you.
All my personal lesson files are available to members in the description 🙂
Yup, never trust the user and never trust the client.
18:19 Were the users able to see/obtain the code of our formhandler.php?
you explaining very well !
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??
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.
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?
How would you view the persons information that they type after setting the user back into the home page?
@20:20 How do you send the user back with the error message or send the user to another page with the data we just collected?
Please make a video on how to create new project with backend and frontend that have admin control
thanks
hi on my site instead of echoing user inputs i get this massage "Warning: Undefined variable $_name " did you ever get that and how do you resolve it?
This is irrelevant but you look like Elon Musk and Mr Beast combined.
Thanks for the guides though! I just started learning about PHP so hopefully all goes well.
could you/should you use "required" on the client-side as well as the server-side validating of the empty field? or is that unnecessary?
“required” is just there to give a visual indicator. 🙂 You’ll even notice that even though it is supposed to prevent the form from being submitted, if you spam the submit button fast enough, it will still occasionally submit the form… So security wise, “required” is pointless in itself.
So if you feel that you wanna add it in, go ahead. 🙂 It is an easy and fast way to notify a user, if they forgot to fill in an input. Just know that it is ONLY a visual indicator.
One of the best tutorial.
And bro looks like Elon😅
i love your mustache btw
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
This tutorial is very helpful thank you
but one thing plz upload it daily
Thanks sir Dani! May I ask if what is the main difference between isset and server[request_method] =="POST"?
Both do something completely different, and it is common to see people use isset() for submits like these, which is considered a "beginner habbit". 🙂 (I have made the mistake of using it too).
So essentially... isset($_POST['submit']) checks if a HTML submit field has been passed, and server[REQUEST_METHOD] checks if the form is submitted via the POST method.
When do you use which? 👇
Use isset($_POST['submit']) when you want to verify if a specific form was submitted and processed (since different forms might have different submit buttons).
Use $_SERVER['REQUEST_METHOD'] when you want to detect whether a form was submitted using a particular HTTP method (POST or GET) and it doesn’t depend on any specific form field.
Or explained in simpler terms...
So use $_SERVER[''] to check if a form has been properly submitted using a specific HTTP method like GET or POST, and use isset() to check if a SPECIFIC form on your website has been submitted. 🙂
You can of course use both, to create even better form submission handling. 👍
and thanks 😀
👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽
Any time i try connecting the index.php to my formhandler.php i ger a no server found message
🥰🥰
Hey i have a nasty error "unreachable code" when working on if statement on empty data input.
Hee taught HTML and PHP together
MR BEAST is here😆😆
Bro I don't have money; so I don't buy any update course
Plz upload it daily.
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)
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.
Thank you.
More of security videos about PHP
Dani, you sound like you learned this the hard way😁
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?
Swap the exit and header functions around 🙂
Great...... do u have udemy course in php?
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
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?
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. 🙂
@@Dani_Krossing Yes, it's undefined variables, that was a typo error.
Thanks 🙏