How to display form errors with PHP | How to handle a form with PHP | English subtitles.
Вставка
- Опубліковано 19 вер 2024
- PHP tutorial.
In this tutorial we are going to see how to structure the html form
so we can show possible validation errors.
You can read the article and download the source code from my website:
digitalfox-tut...
If you feel like saying thanks, you can buy me a coffee.
www.buymeacoff...
Φοβερό κανάλι, με ξεκάθαρο και επαγγελματικό υλικό, μπράβο σας και ευχαριστούμε.
Ευχαριστώ πολύ.
Great work exactly what I am looking for
Thanks
😢😢
simple good video
Thank you
Thanks !!
helpful. thank you
Glad it was helpful!
That is a very good tutorial. Keep up the good work.
I'm running on an issue though. Whenever i click the submit button, i jump to an empty script.php page even if i insert 'wrong' data or even if i put the 'correct data without the messages being displayed.
How can i solve the issue ?
Thanks so much for the tutorial.
Hey, this is not supposed to happen. Maybe you have a typo in your code, happens to me a lot.
Check out or download the source code from my website.
digitalfox-tutorials.com/tutorial.php?title=How-to-display-form-errors-with-php
Happy that you liked the tutorial.
Very good tutorial
Thank you
Why we use the null?
You don't have to. When we create a variable without assigning a value, the variable by default has a value of null. Sometimes i set a variable to null, sometimes not. It depends on the moment i guess.
With bootstrap?
No just HTML and CSS, no bootstrap here.
@@DigitalFox-tutorials thank u🙏
when i press submit my page is refreshing and then after refreshing is showing the message can you please help me
That is because when you refresh the page you submit the form again.
Arrow code bad code?
Hey, thanks for the sub. Can you be more specific please.
@@DigitalFox-tutorials I’ve seen many tutorials where they say nested if then statements are bad.
@@DigitalFox-tutorials ua-cam.com/users/shortsAik0WxJWdmg?si=dMhqE4Vwdt_Nm4-L
Nested if statements are not necessarily bad. It comes down on your
code readability. If your 'if else chains' are hard to follow , or you have
excessive nesting, then yes it's bad code because its harder to read and maintain your code.
I hardly use over two nested if statements in my code.
Warning: Undefined variable $username
Warning: Undefined variable $password
I get this problem in php file, value="" . I already have require in html and the script.php already has that variables. Please help
Hey, if you already declared the variable in the php file, check for any misspelling.
Or download the source code:
digitalfox-tutorials.com/tutorial.php?title=How-to-display-form-errors-with-php
@@DigitalFox-tutorials Thanks for replying! I checked the variables, it is the same. I also looked at the source code, I added the terminator but the problem's still there. This is a project for my school so it is a little bit different from your tutorial. The form I made has an action=" ". Maybe that's the problem?
@Schulken Borashen It doesn't matter if the action attribute is empty, check in the php file if your variables are declared outside the if statement, and not inside.
@@DigitalFox-tutorials I have the same problem