User And Admin Login System In PHP MySQL Step By Step | PHP Tutorial For Beginners (2023)

preview_player
Показать описание
#php #multiuserloginphp

How To Make Admin And User LOGIN System In PHP Mysql Step By Step | PHP Tutorial For Beginners

Support This Channel :

Join this channel to get access to perks:

Your support will be really appreciated.

#webtechknowledge

You can connect with me with the given links below:

Follow me on :
Рекомендации по теме
Комментарии
Автор

The source Code :

login.php

<?php

$host="localhost";
$user="root";
$password="";
$db="user";

session_start();


$data=mysqli_connect($host, $user, $password, $db);

if($data===false)
{
die("connection error");
}



{




$sql="select * from login where username='".$username."' AND password='".$password."' ";

$result=mysqli_query($data, $sql);




{




}


{




}

else
{
echo "username or password incorrect";
}

}




?>









<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<center>

<h1>Login Form</h1>
<br><br><br><br>
<div style="background-color: grey; width: 500px;">
<br><br>


<form action="#" method="POST">

<div>
<label>username</label>
<input type="text" name="username" required>
</div>
<br><br>

<div>
<label>password</label>
<input type="password" name="password" required>
</div>
<br><br>

<div>

<input type="submit" value="Login">
</div>


</form>


<br><br>
</div>
</center>

</body>
</html>









adminhome.php



<?php
session_start();



{

}

?>

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<h1>THIS IS ADMIN HOME PAGE</h1><?php echo $_SESSION["username"] ?>

<a href="logout.php">Logout</a>
</body>
</html>




userhome.php


<?php
session_start();



{

}
?>

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<h1>THIS IS USER HOME PAGE</h1><?php echo $_SESSION["username"] ?>

<a href="logout.php">Logout</a>

</body>
</html>





logout.php




<?php
session_start();
session_destroy();


?>

WebTechKnowledge
Автор

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. :)

saloni.
Автор

this short video tutorial was really helpful. Thank you.

joganidarshil
Автор

sir everything is easy to understand i like this video it is in full detail

kenilgsja
Автор

This is excellent. I have been looking for something of this kind

jamesmut
Автор

Thank you Sir!
Just what i was looking for to work with as a base template in creating my login portal.

Xiaoharuko
Автор

You have taught me alot than my teachers😍😍 thank you so much

justbeing
Автор

Great job, i like it so much and you made it very simple.

eddiebrempong
Автор

Awesome very straight forward and good
Thanks so much it was really helpful

zixkqvu
Автор

thank you so much saved my life, liked!

HybridThunder
Автор

Thank you very much my friend its work

teamnorteth
Автор

Great base model for testing. Thank you for your time. I did try the student user first, but some files such as css are missing.

ismzaxxon
Автор

thank your sir this video very helpful 🙏🙏

meetamanhar
Автор

Thank you very much! Keep up the great work!

Jenny-nowi
Автор

thanks u bro i maked awsome project !!!

balkanforum
Автор

I really liked how each line was explained thoroughly! Subscribed :)

mysticalstardust
Автор

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.

EricAstarcom