Hey Simon], Thank you so much for your kind words and support! I'm thrilled to hear that you found the PHP tutorial helpful and that you enjoyed it. Your encouragement means a lot to me, and it motivates me to keep creating more valuable content for you and others. If you have any specific topics or requests for future tutorials, feel free to let me know. I'm always looking to provide content that helps my viewers succeed in their programming journey.
Hello , great tutorial! I just got one question , i did everything like you , checked twice , my registration data is not showing in database. How should i check for errors ? Thanks
Hello, I'm sorry to hear that you're facing an issue with the registration data not showing in the database. Let's try to figure out what might be causing this problem. Here are some troubleshooting steps you can follow: - Double-check the Database Connection: Ensure that your PHP script has the correct database connection credentials, such as the database host, username, password, and database name. A typo or incorrect information in the connection settings can prevent data from being stored in the database. - Verify Form Submission: Check if the registration form is submitting the data correctly to the PHP script. You can add some debugging code at the beginning of the PHP script to see if it receives the form data. For example: - Error Handling: Implement error handling in your PHP script to catch any potential errors or exceptions that might be occurring during the database insertion process. You can use try and catch blocks to capture and log any errors that happen during the database operation. - Table Structure and Columns: Ensure that your database table has the correct structure and columns to store the registration data. For example, make sure there are columns for the username, email, password (hashed), etc. Please go through these steps, and if you encounter any specific errors or issues, let me know, and I'll be more than happy to assist you further. Also, make sure you have followed all the steps in the video correctly to set up the registration process.
Saran bang mending pake static function aja biar rapi contoh Class db{ Static function insert(){} } Cara Panggilnya db::insert(); Jadi gak perlu capek capek buat objek dari classnya lebih praktis dann efisien . .. jadi mirip sama framework laravel (route::get();)
Hello , thanks for the video but how to make log in work with admin and user , i have table in database with user role either admin or user and i want the admin to login in other page and user in other page aswell how to do that ?
Hi there! I'm glad you found the video helpful. To create a login system with separate pages for admin and user, you will need to first create a login form where users can enter their credentials (username and password) to log in. Next, you will need to create a session variable upon successful login, which will store the user's role (either "admin" or "user") in the database. You can then use this session variable to control access to different pages. To create separate pages for admin and user, you can use PHP (or another backend language) to check the user's role in the session variable and redirect them to the appropriate page based on their role.
Hello. You can use packages for that. There's a md5 function in php that encrypts passwords. You can also use google to find functions for hashing or use your own.
Hello @vladtul4606, Thank you for watching the tutorial and for your question! Implementing password hashing is an essential security measure in any login registration system, and I'm glad you brought it up. To apply password hashing in your PHP script, you can use PHP's built-in password_hash() function to securely hash the user's password before storing it in the database. When a user attempts to log in, you can then use password_verify() to compare the hashed password in the database with the entered password.
Hi @harvey8695, That's an interesting idea! While you can pass the entire $_POST global to the registration class, there are a few things to consider: - Encapsulation and Dependency: Passing the entire $_POST may expose more data than necessary to the registration class. It could break encapsulation and create a tighter coupling between the registration logic and the global request data. - Security Concerns: Depending on the implementation, passing the entire $_POST might expose sensitive information or allow unwanted data manipulation. It's crucial to validate and sanitize input data, and passing only the required fields can be a security best practice. - Flexibility and Maintenance: By passing individual fields explicitly, you have more control over the registration process. It can make the code more maintainable and flexible, especially when dealing with changes in the future. - In the end, the decision depends on your specific use case and design preferences. If your registration class can handle the $_POST data securely and without sacrificing maintainability, it might be a valid approach. Thanks for the suggestion! Feel free to share your thoughts or any further questions you might have.
Ijin tanya bang..sy sdh mengikuti tuturial seperti video tersebut..sy mengalami kendala dalam file function.php erornya seperti ini bang : Warning : mysqli_connect() expects parameter 5 to be int, string given in... Apakah ada solusinya ya bang..makasih🙏
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Login::login(), 0 passed in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\login.php on line 8 and exactly 2 expected in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\function.php:40 Stack trace: #0 C:\xampp\htdocs\WEBL\tugas kelompok\New folder\login.php(8): Login->login() #1 {main} thrown in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\function.php on line 40 gitu erornya bang mohon bantuannya 🙏
Hello @doug7432, Thank you for taking the time to watch my video and share your feedback. I appreciate your input, and I'm always open to constructive criticism to improve my content. I understand your concern about using mysqli and the absence of certain advanced features like a router, template system, models, and controllers. You make valid points, and I completely agree that there are more sophisticated approaches to building PHP applications. The purpose of this video was to introduce beginners to OOP concepts in PHP and provide a foundation for understanding how to create a basic login registration system using OOP principles. I aimed to keep the code simple and easy to grasp for learners who might be new to object-oriented programming. However, I completely acknowledge that PHP has evolved, and there are more advanced frameworks and design patterns available to create robust applications. As a creator, my goal is to continue improving and exploring new topics, including implementing more advanced concepts in future tutorials. To address your concerns and deliver more comprehensive content, I'll take your feedback into account and consider creating videos that delve into modern PHP frameworks, advanced design patterns, and best practices for building scalable applications. Once again, thank you for your feedback. Your input helps me understand what my viewers are interested in, and it motivates me to provide even better content in the future. If you have any specific topics or suggestions for future tutorials, please feel free to share them, and I'll do my best to incorporate them into my upcoming videos.
Bro Your Code is This Error Bro-----------> Uncaught ArgumentCountError: Too few arguments to function Login::login(), 0 passed in C:\xampp\htdocs\photogram\signin.php on line 11 and exactly 3 expected in C:\xampp\htdocs\photogram\libs\includes\User.class.php:40 Stack trace: #0 C:\xampp\htdocs\photogram\signin.php(11): Login->login() #1 {main} thrown in C:\xampp\htdocs\photogram\libs\includes\User.class.php on line 40
WOWW this the best php tutorial ive got keep it up broo , perfect
Hey Simon],
Thank you so much for your kind words and support! I'm thrilled to hear that you found the PHP tutorial helpful and that you enjoyed it. Your encouragement means a lot to me, and it motivates me to keep creating more valuable content for you and others.
If you have any specific topics or requests for future tutorials, feel free to let me know. I'm always looking to provide content that helps my viewers succeed in their programming journey.
Thank Youuuu❤❤❤
Hi @hoorhazem6414,
You're welcome! ❤❤❤ So glad you found it helpful!
Hello , great tutorial! I just got one question , i did everything like you , checked twice , my registration data is not showing in database. How should i check for errors ? Thanks
Make sure that your database and table name is same with database name in your php connection
having the same problem how did you fix it?
Hello,
I'm sorry to hear that you're facing an issue with the registration data not showing in the database. Let's try to figure out what might be causing this problem. Here are some troubleshooting steps you can follow:
- Double-check the Database Connection:
Ensure that your PHP script has the correct database connection credentials, such as the database host, username, password, and database name. A typo or incorrect information in the connection settings can prevent data from being stored in the database.
- Verify Form Submission:
Check if the registration form is submitting the data correctly to the PHP script. You can add some debugging code at the beginning of the PHP script to see if it receives the form data. For example:
- Error Handling:
Implement error handling in your PHP script to catch any potential errors or exceptions that might be occurring during the database insertion process. You can use try and catch blocks to capture and log any errors that happen during the database operation.
- Table Structure and Columns:
Ensure that your database table has the correct structure and columns to store the registration data. For example, make sure there are columns for the username, email, password (hashed), etc.
Please go through these steps, and if you encounter any specific errors or issues, let me know, and I'll be more than happy to assist you further. Also, make sure you have followed all the steps in the video correctly to set up the registration process.
Saran bang mending pake static function aja biar rapi contoh
Class db{
Static function insert(){}
}
Cara Panggilnya
db::insert();
Jadi gak perlu capek capek buat objek dari classnya lebih praktis dann efisien . .. jadi mirip sama framework laravel (route::get();)
Sip, makasih banyak info dan sarannya, nanti saya akan pelajari lebih lanjut tentang static function. Thank you 🙏🏼
Hello , thanks for the video but how to make log in work with admin and user , i have table in database with user role either admin or user and i want the admin to login in other page and user in other page aswell how to do that ?
Hi there! I'm glad you found the video helpful. To create a login system with separate pages for admin and user, you will need to first create a login form where users can enter their credentials (username and password) to log in.
Next, you will need to create a session variable upon successful login, which will store the user's role (either "admin" or "user") in the database. You can then use this session variable to control access to different pages.
To create separate pages for admin and user, you can use PHP (or another backend language) to check the user's role in the session variable and redirect them to the appropriate page based on their role.
thx bro great video
You're much welcome! Thanks for watching!!!
Hello. Thank you for the lesson. There is only one question. How can I implement and apply password hashing in this script. For example password_hash
Hello. You can use packages for that. There's a md5 function in php that encrypts passwords. You can also use google to find functions for hashing or use your own.
@@dawnstar24 md5 depricated long ago!
use password_hash instead
Hello @vladtul4606,
Thank you for watching the tutorial and for your question! Implementing password hashing is an essential security measure in any login registration system, and I'm glad you brought it up.
To apply password hashing in your PHP script, you can use PHP's built-in password_hash() function to securely hash the user's password before storing it in the database. When a user attempts to log in, you can then use password_verify() to compare the hashed password in the database with the entered password.
could you pass the $_POST global to the registration class rather than passing each field? Any drawbacks to doing that?
Hi @harvey8695,
That's an interesting idea! While you can pass the entire $_POST global to the registration class, there are a few things to consider:
- Encapsulation and Dependency:
Passing the entire $_POST may expose more data than necessary to the registration class. It could break encapsulation and create a tighter coupling between the registration logic and the global request data.
- Security Concerns:
Depending on the implementation, passing the entire $_POST might expose sensitive information or allow unwanted data manipulation. It's crucial to validate and sanitize input data, and passing only the required fields can be a security best practice.
- Flexibility and Maintenance:
By passing individual fields explicitly, you have more control over the registration process. It can make the code more maintainable and flexible, especially when dealing with changes in the future.
- In the end, the decision depends on your specific use case and design preferences. If your registration class can handle the $_POST data securely and without sacrificing maintainability, it might be a valid approach.
Thanks for the suggestion! Feel free to share your thoughts or any further questions you might have.
Thank u
You're very welcome!
Ijin tanya bang..sy sdh mengikuti tuturial seperti video tersebut..sy mengalami kendala dalam file function.php erornya seperti ini bang :
Warning : mysqli_connect() expects parameter 5 to be int, string given in...
Apakah ada solusinya ya bang..makasih🙏
Ada yang salah berarti di koneksi databasenya mysqli_connect(), coba copas dari sourcenya aja dah langsung yang ada di deskripsi 🙏
Baik bang..makasih
Sama2 :)
Mantp bang
👌
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Login::login(), 0 passed in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\login.php on line 8 and exactly 2 expected in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\function.php:40 Stack trace: #0 C:\xampp\htdocs\WEBL\tugas kelompok\New folder\login.php(8): Login->login() #1 {main} thrown in C:\xampp\htdocs\WEBL\tugas kelompok\New folder\function.php on line 40
gitu erornya bang mohon bantuannya
🙏
Kayanya kamu ada nulis kode yang salah/kurang. Coba pakai source code yang ada di deskripsi video dah
@@DavidGTech udah bang udah aku copy paste
Ok, tunggu yah, nanti bakal saya coba dengan source code yang saya berikan
Saya tadi udah coba sih dan hasilnya bisa, sama sekali tidak ada error seperti yang ada di video
THANK YOUUU
You're welcome! Thanks for watching...
Log in form error varuthu
2022 and u still use mysqli. no router no templatesystem no models no controllers and redundant code. thats not the power of oop. try it again
Hello @doug7432,
Thank you for taking the time to watch my video and share your feedback. I appreciate your input, and I'm always open to constructive criticism to improve my content.
I understand your concern about using mysqli and the absence of certain advanced features like a router, template system, models, and controllers. You make valid points, and I completely agree that there are more sophisticated approaches to building PHP applications.
The purpose of this video was to introduce beginners to OOP concepts in PHP and provide a foundation for understanding how to create a basic login registration system using OOP principles. I aimed to keep the code simple and easy to grasp for learners who might be new to object-oriented programming.
However, I completely acknowledge that PHP has evolved, and there are more advanced frameworks and design patterns available to create robust applications. As a creator, my goal is to continue improving and exploring new topics, including implementing more advanced concepts in future tutorials.
To address your concerns and deliver more comprehensive content, I'll take your feedback into account and consider creating videos that delve into modern PHP frameworks, advanced design patterns, and best practices for building scalable applications.
Once again, thank you for your feedback. Your input helps me understand what my viewers are interested in, and it motivates me to provide even better content in the future.
If you have any specific topics or suggestions for future tutorials, please feel free to share them, and I'll do my best to incorporate them into my upcoming videos.
Aki sudah buat source crud php mysql pake static function bang kalo berminat bisa download source codenya di website ku
Wow, sip, makasih banyak lhoo
@@DavidGTech yoo
Bro Your Code is This Error Bro-----------> Uncaught ArgumentCountError: Too few arguments to function Login::login(), 0 passed in C:\xampp\htdocs\photogram\signin.php on line 11 and exactly 3 expected in C:\xampp\htdocs\photogram\libs\includes\User.class.php:40 Stack trace: #0 C:\xampp\htdocs\photogram\signin.php(11): Login->login() #1 {main} thrown in C:\xampp\htdocs\photogram\libs\includes\User.class.php on line 40
Actually, there is no error, maybe in your code there are some missing codes in your code. Download the source code (link in the description)
@@DavidGTech no bro i try your code is error please send your instagram or telegram @username i send screenshot and video proof bro please reply bro
Instagram => @davidgrcias
@@DavidGTech bro i am dm you
@@DavidGTech come to instagram online
please give me the code
Source code in the description of video
Tu vivi nell aria
Thank you for watching
Bro your Instagram page showing invalid please give your new id
I temporarily deactive my Instagram account due to I've got a lot going on
@@DavidGTech 🥲🥲
Just give your Instagram username, I will follow you after I activate my Instagram back, thanks!
thank you
You're welcome!!! Thank you for watching...