28 | Let's Create A Signup System in PHP! | 2023 | Learn PHP Full Course for Beginners
Вставка
- Опубліковано 1 чер 2024
- In this PHP tutorial you will learn how to create a signup system in PHP, by using all we have learned up until now! You will also learn about error handlers, MySQL databases, security basics, the MVC pattern, and how to show error messages to the user. 🙂
➤ LINKS
My OOP PHP Course: • 1: Introduction To OOP...
➤ CHAPTERS
00:00:00 - Introduction
00:02:51 - You will learn about the MVC pattern...
00:04:30 - The HTML you need to have ready!
00:06:09 - The Users database table!
00:07:15 - Connecting to your database
00:12:41 - Session config file
00:19:58 - Creating our signup.inc.php file
00:24:26 - Creating our model, view, and controller files
00:29:32 - Signup error handlers
00:52:57 - Show error messages to your users
00:58:20 - Signup our users if no errors
01:03:23 - Show signup success message to your users
01:04:56 - (Fixing an error)
01:05:23 - Testing our Signup system
01:06:33 - Keeping the form data, if the user made an error
➤ 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 UA-cam 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
LESSON MATERIAL:
If you got any errors and need my personal files to compare with, you can find a link for all my available lesson files in the bottom of the description. 🙂
How can I be like you 😭😭
@@nelsonke6840 It's simple! Learn one new thing every day, and by day 365 you will have learned 365 new things. 🙂 Learn two new things a day, and you'll know twice that.
That's the simple rule I go by, to not let new knowledge overwhelm or demotivate me. ☺ One step at a time, and eventually you'll reach your destination.
I can't find it
Look, I didn't understand correctly, but if your intention was to make a link available to everyone, including non-paid subscribers, there is no link in the description
by the way excellent material thank you
This lesson is difficult, but I don't think any teacher can teach better than you did. Thanks a lot for your efforts!!
True true, well said. The guy is legendary on point. I can't find any other guy more suitable than him to teach this difficult lesson. His way of thinking logically even in terms of the security of the system, and the way he has introduced the MVC is top-notch. His way of coding is unique even in terms of organizing the code flawlessly. A thing rare to find on other tutorials. I have learned a lot from him. I will keep repeating the tutorials and perfecting my code skills until I become a master in PHP then move to the framework (Laravel).
Don't usually comment on youtube, but I'm pretty sure you just saved a subject for me this semester.
I've no idea if I would've been able to complete my university assignment on time if I don't find your series.
Thank you! Thank you a lot!
same, man's saved my advanced database module
yooo thank you so much for this. I love when the tutor shows you how to do things in real time, even if it takes a while. I love the patience
I'm learning PHP for build my career in Tech industry. And I found you Dani.. Your way to teach is so good!
Thanks Man!!
Daniel, i woke up this morning thinking something to myself. Your present set of tutorials are BETTER than the series you did in about 5years ago.
Why is it so? I can not tell. I earnestly wait to see the next these days. Keep it up please. Thanks alots
Thank you 😊
I was so hyped for this project and now that i did it i can see how many new things i learned and got a very good idea of how the actual signup may work. Marvelous upload Dani 🔥🔥
Brother. Best PHP videos i've found. Outstanding.
What a great tutorial. At first well explained, super easy and good to follow because at the right pace. Compared to your two previous login systems in PHP, this one is even better, don't get me wrong, your previous tutorials also been great. With that said, I can't await part 2 coming out, and please keep up the good work. Have a great day, Daniel.
Thank you so much for this course! I can't express how grateful I am to you for helping me overcome my initial hesitation with PHP. Thanks to your clear explanations and thorough guidance, I finally feel like I'm starting to grasp more and more. Your efforts have made a huge difference in my learning journey. Looking forward to diving deeper into PHP and expanding my understanding even further. Keep up the amazing work! 🚀👏
Additionally, I've signed up for your Patreon to support your fantastic work even further! 🌟
What an amazing tutorial Dani! I really appreciate the fact that you explain even the simplest thing over and over again, using almost the same words every time, as if you try to explain something simple to a child. Nothing is taken for granted even after having explained something 2 or 3 times already, or even in a previous video of the series. Repetition is what makes something concrete in our brains, and you do this the best way possible IMO! Thank you very much! 👌💪
you're a legend man, thank you for this incredible course!
You teach way better. Stay blessed.
This is AMAZING!!!!!!!! WOW! You are an amazing teacher and programmer! Thank you very very very much!!!
Best tutor ever ! much thanks from Morocco.
Thanks Daniel for gracing us with another great tutorial😊
Wooo! Got in working after whole day of searching for errors. Gonna drunk myself now :-D
THANK YOU FOR THIS TUTORIAL! THIS HELP ME TO CREATE A SYSTEM. All of the small information I wrote in down.
Dani's tuts are way better than any on Udemy. Thanks Dani for everything.
Wow, this is great! Cheers from Baltimore.
You are the best Dani... Thank you..
thank you for new 2023 php raw and simply lessons, i can wait for more projects with no frameworks that are very complex, please make a more just MVC and no OOP and complexity, you are very well explain every think, perfect php series, liked and follow!
Keep making these Dani - you're doing great
excellent! thank you!
Great job and amazing tutorial!
If you are thinking about a login system next i would love one that uses a role on the sessions in order to unlock some content of the webiste if you are a admin, a normal user etc. Keep it up!
Thanks for sharing this Dan. Your instructional videos are the best. I’ve learned so much from coding along with you 👌
Thanks! 😊
What an tutorial, great explanation ofc, really enjoy and learn a lot from this, even I need create my own HTML and CSS but worth to watch
Thank you very much. I will definitely be checking out part two. But I do have a request can you do a video that goes along with this where you can add forgot email or password options.
Perfect🤙🏽
excellent! thank you from indonesia 👍
Very helpful tutorial thank you
Your PHP tutorial is amazing. I am learning so much. I hope you will create a tutorial for laravel someday!
thanks my friend
amazing
Love the series, helped me alot. I did find a mistake tho... 47:05 the query needs to take all the emails form users and not the usernames.
This reminds me of why I hated PHP in college, very good tutorial and very informational.
Great course. You should have a UDEMY course. Nice Job Dani.
Thanks Dani. I’m a big student of urs
I'm gonna watch this video ten times , its so important, i gotta master all these!
Great example but a little bit confusing. I need to watch it again. Thanks Dani. Are you considering preparing a laravel tutorial?
You're the best teacher Dani. We need Laravel course
good Video
You are good❤❤❤❤
Thank you
great video! I was surprised by how much you have thought about implementing a robust system. This is easily production ready code. Thank you for teaching :)
Thank you. ☺ It is not production ready code though. 🙂 There are much missing in terms of error handling, and hack prevention. But it's a good video for learning the basics .
@@Dani_Krossing at least it's better than what I have found in other tutorials.
Love you!
Nice to learn the saver way of data handling from you!
Question:
* Why not repaet password as you did in the earlier course?
* can you show how to do it with the radio_button?!
Thanks dani ❤
I've learned alot from this video, but I think it is unnecessarily advanced in the way it builds up all of the security, errors, exceptions and supporting files. While these are all implementations a beginner may come across this is hardly accessible to a beginner when the most basic functional password validation is nested in 7 supporting files.
❤ thanks
Will you ever make a tutorial about API's as an additional tutorial next to PHP? For posts, comments, etc
Please when is the login episode coming up. Really appreciate your works so far
here i am a few days later having finally finished the video...lol... i had to break it into parts due to other stuff. havent watched the next video yet if its out.... have you checked the code yet for checking email already registered. i remember a variable not being changed when checking this part
Can you do a 2023 update for a login system and forgot password? Love your vids btw really helpful. Thanks
Another great video, just an observation might be worth mentioning filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE) as it supports email addresses with characters from other languages. Otherwise some addresses with foreign language characters would return false.
Hello Dani, great job, may i ask if you are using a php formatter in vscode? and how to configure it, cause ive having trouble with it, greetings from Peru
It was so helpful! I'm creating admin panel for my project. It would be nice if you made video about using volley php and creating profile picture setup. Or at least video on php creating profile picture setup. I'm trying to create android app and inside fragment_userprofile I wanted to let user set picture for profile but getting stuck as It was my first time doing volley php project.
Hey i have built website with your login system, and its amazing, not this one, i have watched the one that is a year older but still amazing work, but could you do forgotten password recovery in OOP PDO PHP kind of stuff? I tried to find something on the internet and theres nothing, because you know i think o lot of people have built a login system based on that video, and video you have on your profile doesnt seem to continue on the logic you have implemented in that year old one, so i would really apreciate it! :D
hey Dani, ur videos were a great help but can i know how to do things like password strength checker, limited password attempts and even using google captcha features.
Hi my teacher! Very interesting video. But can you make another video for this signup/login system using PHP OOP and JS in frontend? P.S: I'm the one of that guys that are adept of OOP
@regimatic
0 seconds ago
I watched this twice. I think you went from crawling to running without learning how to walk. I watched and performed all the previous 27 lessons. This is over my head. You got into object oriented programming (I guess): arrays within PDOs, methods, sessions, try-catch, MBC-model, etc. I think I needed another 10 lessons to truly understand this. To use this on a project, I'd have to paste your code and pray... because I couldn't duplicate a custom effort. I wish you would have just showed us how to do it as procedures. I though I learned something with lesson 1-27 (and I did), but now think I need something in between lesson 27 and lesson 37. I TRUELY like our training, but am lost here.
great tutorial!! only 1 problem, does not work when I use the 2 ini_set()... statements :-/ When I discart them it works but it is less secure I presume?
25:31 question about this part, after following the tutorial and achieving success of bringing my data onto the database, I've noticed that my username and password is set to "root" and blank respectively. after i moved my declaration after the request_once portion it's now working perfectly, any reasons to why this happens?,
Hi Dani I really appreciate the tutorials. I have gone through this tutorial line by line using your lesson files. For some reason the query on the login_model.inc.php is not returning data when I have it echo the results....just get the word Array with no data.. It says I am logged in successfully, but I'm not getting error returned if I leave out something, and it is not returning the :"logged in as" when I successfully log in. Also when I try to echo $_SESSION variables I get not return. Any suggestions
Can you please make a playlist on bootstrap or tailwind on a PHP based website. Raw CSS is very hard.
When I try using the session config my php didn't work on host ip address but it's work when I use localhost
Is it good to make 'domain' => $_SERVER['SERVER_ADDR'] ??
I was wondering if you are planning to create something a bit more complex? To work with Laravel in MVC model?
Yes, I have planned to make a few “Laravel for beginners” videos, once I have wrapped some of my existing ongoing videos in a neat bow tie 🙂
Good Video, any Chance you could do this Video again but with the MVC Model?
I have a "OOP PHP login system" tutorial on my channel, which shows this 🙂
Mr. daniel i use php file and when i try to use font awesome or another icon it not show up on live server what shoud i do ?
Just a heads up, if anyone has any errors along the way, it is 99% a simple typo. I spent almost an hour trying to figure out why the error handlers don't work and its because I wrote config.session.inc.php instead of config_session.inc.php lmao
lol.... im at time stamp 24:42 and already see some refactoring that i would personally do. Just a habit of mine from coding in kotlin and java for a few years now.
also, meant no disrespect. Just the code organizer in me would have arranged those if statements in a different manner. you're good at what you do.
@@CoderzF1Personally I had just used a exit() function and not used a else statement. 🙂 But when recording at the same time, the brain unfortunately oversees that type of details hehe.
Hy @Dani_Krossing At 57:27 I am getting this error "Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)" what am i doing wrong?
Dani, I agree with all the people stating about your teaching abilities. I saw your last message which stated about you getting a job and going to work. That is definitely our loss. I do have one question which I hope you can answer for me. Since I am working with WordPress, I cannot use index.php. What would you recommend I use instead? I definitely appreciate your feedback. Thanks.
Thanks for the kind words 😊
If you are referring to creating a login system, then it is very important to point out that the one I teach in this video, is not a production ready login system. It is simply a lesson to get people used to using PHP. 🙂
If you use Wordpress, then I recommend investing in a up-to-date login system plugin.
Other solutions that are typically used IRL, is a framework like Laravel, since it has security build into it.
My point is, that creating something as important as a login system, which requires TOP NOTCH security, should not be build from ground up… unless you are an expert in PHP security. Most professionals use frameworks and other tools, since features like this already exist, which are better than anything we can make ourselves. 🙂
Is it a must to add the db.sql file in vscode editor ? If not why did you put it there - was it just for explanation purposes ? 😭
How do i fix that error, you said to remove the form input fields and create a function. I did everything you did. But when i click submit on my form page i get an error. How do i fix it pls
Please make video on Login system also I am waiting
Hi all, 👋 I know it's probably beyond the scope of this tutorial but is anyone having issues with the "check_signup_errors()" when using Safari. It all works perfectly in Chrome etc etc but the _SESSION isn't returning the error data to the index.php page when using Safari it only returns the 'last_regeneration' when var_dump'd/print_r'd. As I say all works perfectly in Chrome just wondered if anyone had similar issues when using Safari. (and maybe a cheeky link for a solution 😁) Many thanks for the Tutorials Playlist Dani a lot of effort must have gone into making this.
i can't show error message in any browser, I am still trying to find where I did wrong...
我愛老高
I think you can skip the bindParam and put an associative array in the execute, like so:
$stmt->execute([':username' => $username]);
Yes you can. 🙂 But it comes with some “drawbacks” as well. Or rather “features you can’t do”. But in this example here either way is perfectly fine.
Hey man, great tuts, but i tried to pay the patreon, but is not working, im from Portugal...
Is there any way you could show us how to actually host our websites, and what to change in e.g. this sign-up system code such that it is compatible for when the website is not being hosted locally anymore?
All you gotta do, is log into your dashboard on your hosting companys website, and in there it will have a link to your database. 🙂
In most cases hosting companies provide a MySQL database identical to the phpmyadmin we used in this lesson here.
You will also find the database information in the dashboard, which tells you the information you need to replace inside the dbh.inc.php file.
Then all you gotta do is either create the tables inside the online database, or export the one from your local project, and import it into your online version.
I can't give you a specific tutorial, since all hosting companies have a different dashboard interface. So if you can't find the database link once logged in, then my best advice is for you to contact them and ask where it is. 🙂
Why do I keep having fatal error about 'require_once 'includes/config_session.inc.php'; while I wrote everything
Hello sir, I have a question, why the errors displayee on the screen do not appear. When, for example I don't fill out the fields, absolutely nothing happens, please help
Notice: Array to string conversion in includes\config_session.inc.php on line 7 ...... does anyone know why im getting this?
❤❤❤❤
When I joined and went to compare your files to mine I had noticed that not all the files where there for the 2023 php courses
Hello, can you create a tutorial on how to do a continue with Google account and continue with Facebook account? At least a continue with Google is enough
most sites do not show back entered username or password if wrong or taken, they simply show an error so you don't know which is wrong
ok, no matter what i do, i cannot get the page to flag up if details have been entered. It just logs me in and takes me past this page
Query faildSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected
i cant find the materials for this tutorial in my membership sir
For whatever reason, whenever I tried to add a new user and some bad data, it worked - throwing an error. Then i would add a new user with good data - it would spit out my success message BUT it would retain the old BAD data in the inputs... So i added an unset($_SESSSION) to rid the data after a successful signup.... I was wondering if that was a good thing or right thing to do.?
Same thing happened to me and I added the "unset" if there was an unsuccessfull signup instead, meaning right after I clear off the "error_signup" session variable, idk it just makes more sense for me that way.
Would it be a problem if i used mysqli to connect to database instead of PDO?
Nope :) It's just to different ways of doing it, each with their own benefits.
Thanks! btw if i wanted to add a remember me option would it be hard to implement it myself using cookies? @@Dani_Krossing
and maybe a dumb question but when uploading my website to like heroku, i would need to adjust he cookie_param domain ,set in the config file right?
I refresh page why username and email are remained in input field . Thank you.
in the "check_signup_errors()" function where you check for "isset($_SESSION["error_signup"])" add this:
unset($_SESSION["signup_data"]);
--------------------------------------------------------
simpty you clear off the session variable that holds the old data after you use it in the view.
I have a question
I do the same thing just like tutorial
But when i click the button ,the page will go to “signup.inc.php” and show nothing on the page .
How can I solved this problem ?😢 I would appreciate it if you can give me some advices !
It means there is a typo in your code, or your database table doesn’t match with the SQL query in your code. 🙂
@@Dani_Krossing hi , thank for your reply , i check the code found that
my data can send to database ,and when i click the return key (at the top left of the page)
it will go back to my index.php page, and show error messages correctly!
I wonder why i need to click the return key from signup.inc.php to index.php , but can’t just go to index.php page
Really thanks your reply !😊 it’s very kind of you
how to prevent the host provider from copying and pasting ypur whole code and work and use it or even sell it with a a few mouseclicks?
Pick a well known and trustable hosting provider, and not some weird unknown hosting provider. Or set up your own server, even though that is a lot of extra work.
@@Dani_Krossing You can't trust anybody nowadays but having your own server seems the "most secure" way to prevent your serverside-coding-effort from getting "stolen". Thx.
👍🙏
The error handler is working, but when I input the correct data and click the "Sign Up" button, it doesn't send the data to the database. Could this be because I didn't use XAMPP and instead directly installed PHP on my PC? its not connecting to my database 😴🤔
$host = 'localhost';
$dbname = 'signup';
$dbusername = 'root';
$dbpassword = ' ';
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $dbusername, $dbpassword);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Connection failed" . $e->getMessage());
this is my dbh.inc.php and also im using MySQL workbench
Most commonly when you experience this issue, of it not posting anything to the database, while not giving you any error messages, is when the SQL statement doesn't match up with your database table.
So I would triple check your $query value, to make sure it matches up, and there are no spelling or syntax errors.
If the issue was your dbh.inc.php file, then you should receive an exception because it couldn't connect. So I'm guessing that's not the issue.
@@Dani_Krossing Thank you for always replying. I have already fixed the problem, and perhaps I was just getting overwhelmed by the new things I learned.
Glad you got it solved 🙂
And here is me waiting for the Login video
I just edited the video, and will upload it tomorrow. 🙂
You are such a genius, how can I get ur source codes bro
My personal files are available to members in the video description 🙂
@@Dani_Krossing the link u dropped isn’t going
@@olugbengatemitopeajose688 I tested both links, and they work. 🙂
Fatal error: Uncaught Error: Call to undefined function check_signup_errors() ON LINE 53, Why do i get that?
It means the function doesn’t exist. So either you misspelled the name, or you didn’t link to it correctly 🙂
Thanks! currently rewatching the video to find where I made a mistake@@Dani_Krossing