spent the entire day looking through countless videos to create a login system to no avail. So glad that I found your video! I was able finish the whole thing from scratch within 30 mins. :)
When I was testing the error message for username or password incorrect. I'm getting: Warning: Trying to access array offset on value of type null in D:\secure\project\index.php on line 20 Warning: Trying to access array offset on value of type null in D:\secure\project\index.php on line 23 Username or password incorrect. How do I fixed this without showing the warning
Thanks so much. Please do you have crud tutorial on php and mysqli like the laravel tutorial you have already created. It will be appreciated if you could implement the crud tutorial using php. It will get you more subscribers because your tutorial is the best on youtube.
Thank you for this but please, when I login in, I don't see the username displayed And when I add the Access denied code for non logged in users, even a registered account is redirected to the login page
hi i want to ask can i change my html file to php file? since i need to connect to my login.php / register.php and can i made other than user and admin to specific admin email and user email ?
I found this error : "Notice: Trying to access array offset on value of type null" The line is if($row["Usertype"]=="User") & if($row["Usertype"]=="Admin")
Since you are only checking to see if the username session variable is set, once you login as a regular user, you can then type the URL for the admin home page and gain access.
Yes there is.. Send the usertype using session just like you send the name. Like this - $_SESSION['usertype']="user"; Then in the userhome write a else if condition Like this - elseif($_SESSION['usertype']="admin") { header("location:login.php"); } You have to do the same for adminhome Hope you are clear.
I got this warning "Warning: Trying to access array offset on value of type null" with admin account only, what happening? and what should i do? thank you
Why i got this error ?? Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\SIP23PROJECT\User.php on line 25 Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\SIP23PROJECT\User.php on line 30 username or password incorrect
Thank that so helpful. But there is one problem I encounter why is it after logging in I couldn't enter to homepage, is it because of my database? Thank you.
Its fine to create different table for user and admin..but why you want to create a separate table for admin. Probably you will have a few admin data . so creating a different table is unnecessary. It's better to keep the number of table as minimum as possible. So it depends on your decision.
when user logged in it goes to specific landing php page..but when user change the url to admin.php its opening ..who to authencate the page with usertype before loading
Checkout this tutorial. Then your issue will be solved. Here i make it a little detailed. Check around at the end. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2-h0Pqyd3Io.html
Ok thank you now it is working. But when I enter the passwort incorrect . This warning appears: Trying to access array offset on value of type null in C:\xampp\htdocs\login1\authenticate.php on line 40 i think because the array is empty. How can I catch the error that it only shows username or passwort incorrect?
hello how i can change user to be an admin from backend ?? i know i must make a register page and all data go to database can i know how i make some user be admin not from change his statues from phpmyadmin
For adding admin you need to store usertype as 1 from the code. What you can do is that you need to make form in admin dashboard for user table. While inserting data to the table you need to insert usertype as 1 by default in controller.
This helps me so much sir, but I'm having a problem on the "else" wherein if you input a wrong password or user it should state that it's incorrect but mine says error but it still output the incorrect Warning: Trying to access array offset on value of type null in D:\xampp\htdocs\login\account.php on line 31 username or password incorrect
I encounter a problem around the 21:42, I keep getting the error Warning: Trying to access array offset on value of type null I have tried every solution I see on the internet but nothing worked, I hope you can reply even though the video is 1 year old, and to anyone who encountered this error and were able to solve it, can you kindly reply what solution you have done? Thank you in advance.
pretty sure after login in as user you can, type in the adminhome.php and have access to that, because theirs no role check so maybe add this: adminhome.php The same for userhome.php.
elseif($row["usertype"]=="admin") { $_SESSION["username"]=$username; header("location:adminhome.php"); } PLEASE HELP ME, IM ERROR with that line it gives this warning "Warning: Trying to access array offset on value of type null"
Hi, your tutotial is very helpful, but i don't know why my page when i click login, is show me(Fatal error: Uncaught TypeError: mysqli_fetch_array(): Argument #1 ($result) must be of type mysqli_result, bool given in D:\Xampp\Xampp\htdocs\Delivery(final)\login\login.php:29 Stack trace: #0 D:\Xampp\Xampp\htdocs\Delivery(final)\login\login.php(29): mysqli_fetch_array(false) #1 {main} thrown in D:\Xampp\Xampp\htdocs\Delivery(final)\login\login.php on line 29), can you help to solve this?
where you are running mysqli_query , add 'or die( mysqli_error($db)' e.g $sql = "SELECT * FROM users"; $result = mysqli_query($db, $sql) or die( mysqli_error($db));
how to fix? Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\project\login.php on line 31 Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\project\login.php on line 39
Warning: mysqli_connect(): (HY000/1049): Unknown database 'user' in C:\xampp\htdocs\login\login.php on line 11 connection error how to fix? The code was correct but still it looks like that.
@@bautistadalisaymilenem.4722 1st solution : Check if the database name is exactly like in your code . 2nd solution : Check my.ini file of mysql and verify port number. Im most of the cases it runs on 3306 however if it is running on 3308 then edit your connection file: $conn = mysqli_connect($server_name, $mysql_username, $mysql_password, $db_name, "3308");