Jump to content

Recommended Posts

Posted

hello mates today i will be teaching you how to make simple login system with php

ok lets start with login.php

 

code :

 

<?php

$username = $_POST['user'];
$password = $_POST['pass'];

if ($username == "Admin" && $password == "l33t")
{
header( 'Location: http://www.yoursite.com/Admin.html' ) ;
}
else
{
echo "wrong password or username";
}
?>

 

so now when you are going to login it will redirect you to a page in your site called admin.html or any other page you want all you have to do is change admin.html with the page name..

note :

the page must be uploaded in the same directory of the login.php file...

 

login.html code :

 

<html>
<head>
<title>Login Page!!</title>
</head>
<body>
<form action="login.php" method="POST">
Username: <input type="text" name="user"><br>
password: <input type="password" name="pass">
<input type="submit" value="Login">
</form>
</body>
</html>

 

now you can make any other page so when you login it will redirect you to i will just make simple one using codes from my previous html tutorials..

 

<html>
<head>
<title>admin page.</title>
<body>
</body>
</head>
</html>

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock