No it is not. 🙂 However it is important to know the difference between them, since they serve different purposes. I'll briefly explain them bellow. 😊 For the sake of my explanation, let's pretend I somehow managed to type
@@Dani_Krossing Thanks for replying Do you have courses at Udemy, I tried to reach you but did not find. I would suggest if you create multi tenant for core php, "not laravel" It will be very helpful for most people because there is no available course for multi tenant core php
@@amirgohary Everything I create is freely available on RUclips. 🙂 One of my main goals when I started this channel, was to make sure that people who couldn't afford college, had a place to learn.
whoa thought you were done with PHP. Glad to see you are still building tutorials for it. I am a full time PHP developer now and I started learning to code from videos of yours from ages ago. Well before ChatGPT, tuts like yours were one of the best ways to learn. I still use your file upload script that I built from watching your tutorial back a million years ago
I would like to take this opportunity to thank you for the great work you are doing, you explain everything in details until everyone understands. In university lectures don’t even teach the way you are,simplifying all the complex concepts. You have given me hope to continue learning programming. Stay blessed 🙏
Thanks, Dani! Your videos are great. They make learning so much easier, because I watch not just because "I have to learn", but because they're fun to watch and easy to understand. And that's quite an achievment, if you ask me!
Dear Dani, it is a pleasure to watch your tutorials. Thanks for your work! You are wondering why it is possible to type in some letters in the numb-input-field and the reason for that is: "The number e (Euler's number) is a mathematical constant approximately equal to 2.71828 that can be characterized in many ways."(src="wiki")
Learning PHP for the server side just feels right, especially with your way of explaining things. I've been scratching my head trying to learn Flask(python). It feels weird especially because of OOP.
htmlspecialchars() simply converts any special characters into HTML entities. So for example "&" would become "&", which makes it "non-dangerous". Where as filter_input() actually sanitize the data, by returning false if the input was invalid. It's important to mention here though, that php.net recommends always using htmlspecialchars() for string data. 🙂 But if you are dealing with other types of data, then you can use either function, depending on what you are trying to do.
Hello Dani!! Thank you for your videos and all your efforts, you are an awesome person and great teacher! 💪💪💪 I have problem when trying to do some math in "our" calculator. The message I get is this one: Fatal error: Uncaught Error: Undefined constant "num02" in C:\xampp\htdocs\test.php:44 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test.php on line 44 This is part of code if (!is_numeric($num01) || !is_numeric(num02)){ echo "Only write numbers!"; $errors = true; } is causing error..when I delete it then it all works fine. I will put my whole work in next comment so if you have time please take a look at it.
Hello dani, I’m trying to learn how to create a chat system in php. I feel like learning that would take me to another level. Can you do tutorial on that please ?☺️
The letter "e" at 21:52, is it not the Euler's constant? Maybe HTML considers it at a number. Or more likely to be like 1e10 for example, to the power of 10.
Hi Daniel, your videos have been very useful for a beginner like me. Wanted to ask if you can create a video showing how to create a to do list with php. it should have this functions PHP, HTML, and CSS with a connection to an SQL database containing a table for tasks (Bootstrap/Tailwind/Sass or other can be used for styling). Each task should have: A unique ID A title A task description Completion status (whether the task is done) The user should be able to: View all tasks Add a task Edit a task Delete a task Mark a task as completed. Enable the creation of different users on the page and have multiple task lists associated with a specific user, editable only by that user and not visible to other users. Implement functionality to remove all completed tasks. Implement functionality to mark all tasks as completed. Allow users to register and log in to the page, and provide the capability to change their username and other settings such as the page's color theme or other similar preferences. once again thank you for your work much appriciated.
About double or single quotes around 28:15 I did notice that in my code when I don't use quotes to define the class in html it works fine too (in something I created myself). I wrote the following:
You should always follow the regular HTML rules, even when putting it inside PHP. 🙂 There could very well be a specific reason why in your case it works, but maybe not when others test it on their devices or browsers.
haha well when people keep telling me to use "HTML as security", I do find it satisfying to prove those comments wrong in a video 😂 Or at least from knowing that this video won't get those comments.
in the select option if I select multiplication or any other operation after submitted, the select option back to addition it's kind a (default), how can I possibly stick with the chosen operation even if I submit the form? I am hoping to your answer teacher Dani :D
No because if you put a AND instead, then both have to not be numbers before it counts as an error. 🙂 If you put a OR then only one of them has to not be a number.
@@Dani_Krossing Thank you so much for removing my confusion. Your tutorials are really helpful. I have a request for you to make tutorials of Laravel also because, i started internship as Laravel developer and i find laravel really hard to use. Out of all the internet i find only your tutorials helpful so please make Laravel tutorial series.
Hello, I have just started learning php. At 22:48 the is_numeric function also seems to check whether the given variable is empty or not. So, if we use only that if block and remove the if block from 20:38, would it give me some kind of error?
Hello! 21:45 : Why do we need the boolean $errors? Cant we just do the if structure to check if the fields are empty without the boolean and has the same effect?
Hello from Brazil! Why did you use "echo" before htmlspecialchars, after all echo is not to just show something on screen? I tried without it and worked the same. I mean, is there a purpose or does the same? . Its my second day learning PHP, be patient😅
Echo is used to show content on screen, and htmlspecialchars is used to prevent the outputted content to be malicious 🙂 so our website doesn’t get attacked using XSS.
and like @TheSocks221 pointed out you also need to include " $num1 = filter_input(INPUT_POST, "num1",FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); $num2 = filter_input(INPUT_POST, "num2",FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);"
Hello, i créated the calculator but i have a problem. The file works om my brothers Mac but not on my win10. The echo’s do not work on my pc. I don’t see the result and the other echo massages. I use the latest versión of xampp . It’s not a mistake in the script because it works on my brothers system. Other echo’s outside of the calculator do work. What could be be the problem?
I'm having a problem with create html canvas elements with php.. Things that work in html canvas with an html file work, but when i use da canvas element and select it in a js file with php it doens't show..
I tried to do a calculation 100 / 0.5 and it gave me an error. Is that my browser causing that or something else? Anything with a decimal point causes an error. Maybe the age of my PHP software?
I am confused why do you say PHP_SELF can be altered by a malicious user? (starting around 4 minute mark) Edit: it seems that it isn't actually the file itself that is referenced, but instead the url in the browser including any random extra stuff that a person types into the url...
Sanitizing numbers instead of just veirfying that they are numbers seems like a bad idea. How can you trust that the sanitized data was the intended input?
Can't access the project files. It seems like there is text in the description that is intended to be a hyperlink but instead is just plain text. Anyone else having this issue?
i have quetions , why you wrote echo inside action attr in form , why do we need to echo the data ? isnt action attr work is to send data to server ? why echo then ?
Check on your stylesheet! Had same problem but after unlinking my stylesheet everything is fine unless your code got a problem in which case you can turn on display_errors in your php.ini file to see the exact line with the error
I got an error : Fatal error: Uncaught TypeError: filter_input(): Argument #3 ($filter) must be of type int, string given in C:\xampp\htdocs\PHP calculator\index.php:39 Stack trace: #0 C:\xampp\htdocs\PHP calculator\index.php(39): filter_input(0, 'operator', 'add') #1 {main} thrown in C:\xampp\htdocs\PHP calculator\index.php on line 39
Whenever you show any type of text thats html / css (not php) I lose track of the information im learning and things stop making sense. It would be easier if you JUST did php only.
Most PHP is done in coorporation with HTML, so it's important to learn how to use them together. 🙂 You should be very familiar with HTML already, if you started learning PHP. So if you struggle with the HTML part, then I recommend catching up on it, so it's easier to follow along.
Is it wrong to use htmlspecialchars with input numbers instead of filter_input ?
No it is not. 🙂 However it is important to know the difference between them, since they serve different purposes. I'll briefly explain them bellow. 😊
For the sake of my explanation, let's pretend I somehow managed to type
@@Dani_Krossing
Thanks for replying
Do you have courses at Udemy, I tried to reach you but did not find.
I would suggest if you create multi tenant for core php, "not laravel"
It will be very helpful for most people because there is no available course for multi tenant core php
@@amirgohary Everything I create is freely available on RUclips. 🙂 One of my main goals when I started this channel, was to make sure that people who couldn't afford college, had a place to learn.
@@Dani_Krossing that's why you are the best teacher on RUclips ❤
Thank you for this explanation! It helped a lot!@@Dani_Krossing
I'm new to PHP and building this calculator brought so much joy to learning. I wish you had more of these mini projects within your courses.
whoa thought you were done with PHP. Glad to see you are still building tutorials for it. I am a full time PHP developer now and I started learning to code from videos of yours from ages ago. Well before ChatGPT, tuts like yours were one of the best ways to learn. I still use your file upload script that I built from watching your tutorial back a million years ago
I would like to take this opportunity to thank you for the great work you are doing, you explain everything in details until everyone understands. In university lectures don’t even teach the way you are,simplifying all the complex concepts. You have given me hope to continue learning programming. Stay blessed 🙏
Thanks, Dani! Your videos are great. They make learning so much easier, because I watch not just because "I have to learn", but because they're fun to watch and easy to understand. And that's quite an achievment, if you ask me!
Im planning to learn php soon.. i know which channel im gonna watch 😊 thank you for your time
Back to basics 😍. Really enjoy yours videos. Thanks a lot.
I liked your way of teaching. Please continue with it.If you have read my comment, then reply.
Dani Krossing is the man! Been a fan since MMTUTS days!
Thank you so much sir, you are an amazing teacher best of the best
Good tutorial as usual from a nice teacher!
Dear Dani,
it is a pleasure to watch your tutorials. Thanks for your work!
You are wondering why it is possible to type in some letters in the numb-input-field and the reason for that is: "The number e (Euler's number) is a mathematical constant approximately equal to 2.71828 that can be characterized in many ways."(src="wiki")
Learning PHP for the server side just feels right, especially with your way of explaining things. I've been scratching my head trying to learn Flask(python). It feels weird especially because of OOP.
THANKKKKK YOU
18:47 thanks for the tip
You are a Genius!!!
Keep it up bro UR doing Awesome Work 👍
It's nice so much time you take to explaine why en what you're doing
In case of divide, i would also check the value of num2. Division by 0 is an illegal operation.
This is very useful tutorial thank you
great tuto, thanks for sharing 😃
It was a very nice video, thank you. Could you make a video with a few examples to show the differences between htmlspecialchars() and filter_input()?
htmlspecialchars() simply converts any special characters into HTML entities. So for example "&" would become "&", which makes it "non-dangerous".
Where as filter_input() actually sanitize the data, by returning false if the input was invalid.
It's important to mention here though, that php.net recommends always using htmlspecialchars() for string data. 🙂 But if you are dealing with other types of data, then you can use either function, depending on what you are trying to do.
@@Dani_Krossing thnx for explanation
Hello Dani!! Thank you for your videos and all your efforts, you are an awesome person and great teacher! 💪💪💪 I have problem when trying to do some math in "our" calculator. The message I get is this one: Fatal error: Uncaught Error: Undefined constant "num02" in C:\xampp\htdocs\test.php:44 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test.php on line 44
This is part of code if (!is_numeric($num01) || !is_numeric(num02)){
echo "Only write numbers!";
$errors = true;
} is causing error..when I delete it then it all works fine. I will put my whole work in next comment so if you have time please take a look at it.
Love from Bangladesh
thankyou sir
Hello dani, I’m trying to learn how to create a chat system in php. I feel like learning that would take me to another level. Can you do tutorial on that please ?☺️
Thank you
The letter "e" at 21:52, is it not the Euler's constant? Maybe HTML considers it at a number. Or more likely to be like 1e10 for example, to the power of 10.
Yeah I think he just managed to type in the one letter by chance that can be inputted in there lol
Thank you bro
Hi Daniel, your videos have been very useful for a beginner like me. Wanted to ask if you can create a video showing how to create a to do list with php. it should have this functions PHP, HTML, and CSS with a connection to an SQL database containing a table for tasks (Bootstrap/Tailwind/Sass or other can be used for styling).
Each task should have:
A unique ID
A title
A task description
Completion status (whether the task is done)
The user should be able to:
View all tasks
Add a task
Edit a task
Delete a task
Mark a task as completed.
Enable the creation of different users on the page and have multiple task lists associated with a specific user, editable only by that user and not visible to other users.
Implement functionality to remove all completed tasks.
Implement functionality to mark all tasks as completed.
Allow users to register and log in to the page, and provide the capability to change their username and other settings such as the page's color theme or other similar preferences.
once again thank you for your work much appriciated.
About double or single quotes around 28:15 I did notice that in my code when I don't use quotes to define the class in html it works fine too (in something I created myself). I wrote the following:
You should always follow the regular HTML rules, even when putting it inside PHP. 🙂 There could very well be a specific reason why in your case it works, but maybe not when others test it on their devices or browsers.
Hehe really hammering down on the security, almost sounds like you enjoy it 😂
haha well when people keep telling me to use "HTML as security", I do find it satisfying to prove those comments wrong in a video 😂 Or at least from knowing that this video won't get those comments.
Hi danni im a doctor in medical field, can we do a medical oriented project on you channel. such as patient database using php?
Woah that’s cool!
in the select option if I select multiplication or any other operation after submitted, the select option back to addition it's kind a (default), how can I possibly stick with the chosen operation even if I submit the form? I am hoping to your answer teacher Dani :D
would it not be better if we use AND instead of OR while checking if the number is not numeric
No because if you put a AND instead, then both have to not be numbers before it counts as an error. 🙂 If you put a OR then only one of them has to not be a number.
@@Dani_Krossing Thank you so much for removing my confusion. Your tutorials are really helpful. I have a request for you to make tutorials of Laravel also because, i started internship as Laravel developer and i find laravel really hard to use. Out of all the internet i find only your tutorials helpful so please make Laravel tutorial series.
THANK YOU..
can you make a payment system
i used match over switch, is there better use switch rather than match ?
really it's helpful video
22:22 "e" is actually a number :D just like "i" but it is not imaginary :P
Ahh thanks also I want social website in php please project making
Just wondering why using float when you can't entering float number when using type="number" in html ? Thanks, JF
Hello, I have just started learning php. At 22:48 the is_numeric function also seems to check whether the given variable is empty or not. So, if we use only that if block and remove the if block from 20:38, would it give me some kind of error?
could you keep your error handling code separated from the main code? in its own php file.
Hello! 21:45 : Why do we need the boolean $errors? Cant we just do the if structure to check if the fields are empty without the boolean and has the same effect?
Nevermind! I understood that the Calculation part of the code wont run, sorry!
Hello from Brazil! Why did you use "echo" before htmlspecialchars, after all echo is not to just show something on screen? I tried without it and worked the same. I mean, is there a purpose or does the same? . Its my second day learning PHP, be patient😅
Echo is used to show content on screen, and htmlspecialchars is used to prevent the outputted content to be malicious 🙂 so our website doesn’t get attacked using XSS.
Can I use FILTER_VALIDATE_FLOAT instead of FILTER_SANITIZE_NUMBER_FLOAT? Is the same thing? Or are there differences?
one santitzes the other validates
bro how u arranged it fast on 25:51, u alligned it very quick
I found out why it was not working with floats. In the form when we set the
I love the course by the way
and like @TheSocks221 pointed out you also need to include " $num1 = filter_input(INPUT_POST, "num1",FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
$num2 = filter_input(INPUT_POST, "num2",FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);"
Hello, i créated the calculator but i have a problem. The file works om my brothers Mac but not on my win10. The echo’s do not work on my pc. I don’t see the result and the other echo massages. I use the latest versión of xampp . It’s not a mistake in the script because it works on my brothers system. Other echo’s outside of the calculator do work. What could be be the problem?
I'm having a problem with create html canvas elements with php.. Things that work in html canvas with an html file work, but when i use da canvas element and select it in a js file with php it doens't show..
💯💯💯💯
I tried to do a calculation 100 / 0.5 and it gave me an error. Is that my browser causing that or something else? Anything with a decimal point causes an error. Maybe the age of my PHP software?
How can you autocomplete HTML in PHP sir?
but it does not accept float numbers
I am confused why do you say PHP_SELF can be altered by a malicious user? (starting around 4 minute mark) Edit: it seems that it isn't actually the file itself that is referenced, but instead the url in the browser including any random extra stuff that a person types into the url...
Sanitizing numbers instead of just veirfying that they are numbers seems like a bad idea. How can you trust that the sanitized data was the intended input?
Sir some people says that php shall be end! He is really kindly cover this topic in specific video
My first video in this series, talks about that specific issue. 😊 Spoiler alert, "PHP is not dying" hehe
Can't access the project files. It seems like there is text in the description that is intended to be a hyperlink but instead is just plain text. Anyone else having this issue?
The "➤ GET ACCESS TO MY LESSON MATERIAL HERE!" is just the header. The links are bellow. 🙂
i have quetions , why you wrote echo inside action attr in form , why do we need to echo the data ? isnt action attr work is to send data to server ? why echo then ?
I couldn't get why we used POST and not GET??
Echo out for Result is not showing text .. maybe
something went wrong
Check on your stylesheet! Had same problem but after unlinking my stylesheet everything is fine unless your code got a problem in which case you can turn on display_errors in your php.ini file to see the exact line with the error
I got an error :
Fatal error: Uncaught TypeError: filter_input(): Argument #3 ($filter) must be of type int, string given in C:\xampp\htdocs\PHP calculator\index.php:39 Stack trace: #0 C:\xampp\htdocs\PHP calculator\index.php(39): filter_input(0, 'operator', 'add') #1 {main} thrown in C:\xampp\htdocs\PHP calculator\index.php on line 39
It means you accidentally set the operator to check for an integer, when you use the filter check.
Hi sir, I tried this out on my laptop but it ain’t working 😌
link is not working :(
where are yours css files
At the bottom of my description
Whenever you show any type of text thats html / css (not php) I lose track of the information im learning and things stop making sense. It would be easier if you JUST did php only.
Most PHP is done in coorporation with HTML, so it's important to learn how to use them together. 🙂 You should be very familiar with HTML already, if you started learning PHP. So if you struggle with the HTML part, then I recommend catching up on it, so it's easier to follow along.
I'm guessing you are mememing, because he has said so many times that people don't like him showing non-php code.
You look like Elon Musk ..😁
You look quite similar to Elon Musk, so I had to ask whether the two of you are related. 🤭
😂 I though it was only me who noticed
its irritating me that youre teaching very fast and didnt even explain how you did that echo of the error handlers. Now im still confused.
This is very useful tutorial thank you