So make sure that you say your dad, dad and then for lunch and then server and then connection.
Now the next step is that we need, as usual, we need to say if user is not logged in, then we need
to take them to the admin, to the if they are logged in, we need to take them to the account.
But here in this case, if they are logged in, if the admin is logged in, we take them to the, let's
say, the main dashboard.
So let me see Dash.
Board, not BHP dashboard at BHP.
And this is in case the user is logged in and here if is set, log in button.
If the user clicks on the log in button, we need to take the email and the password and then we insert
a user select user ID here instead of user ID, we need to say admin ID, admin ID and then admin name
and then.
Admin email and then admin password and then from from admins where admin email is equal to question
mark and admin.
Admin password is equal to.
Question mark, limit one.
And then we say email a password and we continue here.
We need to say admin ID and then.
Admin Main and admin email admin password.
And then we execute and then we get the user ID, the user name user.
User.
Email user ID instead of user ID.
I'm going to say admin ID and admin name.
An admin email and then logged in here.
We shouldn't say a word.
We shouldn't say logged in instead because we are using another session.
Remember, we are using another session and therefore we need to say admin logged in.
I'm going to say admin admin underscore logged in.
This is very important.
So I'm going to say here.
Admin logged in.
And then if if admin logged in, I'm going to take them to the dashboard dash.
More that BHP then log in access and then logged in successfully and then in case of failure we just
redirect to the same page and the case here in case of error, we also redirect to the same page and
that's it.
Now we need to clear the dashboard.
So let me here you this this index is going to be the dashboard.
And instead of saying index, we can rename this to Dashboard or alternatively we can say index, we
can use say index.
This could be index as well.
So you can here say index that BHP.
And then here you could say.
Index index, that sort of dashboard.
So make sure that this is correct.
Your index.
And here also index.
That's it.
Let me see.
Alamy rename this file to.
Let me rename this to.
Let me rename this to BHP.
It must be BHP.
Lastly, let me create a new account.
As I told you, you should never create a registration page.
You should never.
When it comes to admins, you should never create areas through a page unless you're planning on the
are.
Unless you are planning on hosting it on another server.
But still it's it's dangerous because any user could create an account.
I recommend only creating a log, a page.
And then if somebody if you want somebody to work with you, then you need to create an account for
them and then you need to give them email and password.
So for example, here in the admins, what I'm going to do is that I'm going to click insert and then
I'm going to get a new admin email and password.
So the admin ID is going to be given by the database event here.
I'm going to say admin admin name are going to say amen, amen and admin email.
I'm going to say admin at email dot com and the password and then the password.
The password must be hashed.
You cannot type the password like this.
You cannot say, for example, the password is one, two, three, four, five.
You need to select here from this menu, you need to select MD5.
So you need to look for MD5, which is this five MD5.
By the way, if you don't use this, it's not going to work here.
It's a unique four or five.
So this one, two, three, four or five will be hashed.
This is very important.
Again, if you don't say MD5, it's not going to work.
Lastly, you just need to click on Go and this is going to create a new admin.
So let me show you that.
As you can see now and your advent has been created and it says here admin ID is one name, admin and
email and the password.
The password, as you can see, has been hashed.
So the password is hashed.
But you know, you should know, of course, the password the actual password is one, two, three,
four, five.
But this password is the hashed password.
Now, the last thing that we need to do is that if we do make sure that the input should say log in
end and the method must be passed and the action must be a log in that BHP and the name for the email
is is is email and the name for the password is password.
Let me now turn over to the browser address.
So I'm going to go back.
And then I'm going to go to the log in that now the log in that BHP.
Log in that BHP.
So now in the log in that BHP let me say admin and then at email dot com and then let me see want to
see four or five if I click on log in.
As you can see, it will take me to the dashboard and it says here logged in successfully.
So now I'm in the dashboard and I will be I will be able to use the dashboard if I log it.