Jump to content
xisto Community
Sign in to follow this  
Benz1435

Multiple Admin Login (php) This is a script that doesnt requre SQL

Recommended Posts

first off make a login.html page

 

Code:

<u>Admin Login</u><table border="0">

<tr>

<td><form name="form1" method="post" action="check.php">

<table width="407" border="0">

<tr>

<td width="105">Username:<br><input name="username" type="text" id="username"><br>

Password:<br><input name="password" type="password" id="password"></td>

</tr>

</table>

<br>

<input type="submit" name="Submit" value="Login">

</form>

 

</td>

</tr>

</table>

 


then make a check.php page

 

Code:

<?php

$admin1 = "admin1"; // first admin username

$adm_pass1 = "password1"; // first admin password

 

$admin2 = "admin2"; // second admin username

$adm_pass2 = "password2"; // second admin password

 

if(($username == $admin1 && $password == $adm_pass1) || ($username == $admin2 && $password == $adm_pass2)){

echo "Congratulations <i>" . $_POST['username'] . "</I><br>You may now proceed to the <a href=\"admin.php\">admin area</a>!";

}

 

else {

echo "Username <b>" . $_POST['username'] . "</b> or password <b>" . $_POST['password'] . "</b> is incorrect, please try again"; }

?>


Note: to make more than 2 admins just type this:

Code:

$admin3 = "admin3"; // second admin username

$adm_pass3 = "password3"; // second admin password


Under the other 2 admins names and password and this also:

Code:

 

|| ($username == $admin2 && $password == $adm_pass2) || ($username == $admin3 && $password == $adm_pass3)

then the admin area make it and save it as : admin.php

 

No Database Requred!!

Share this post


Link to post
Share on other sites

It'd work, but is it really a good idea to store the admin passwords in an unencrypted file?

56676[/snapback]


Yeah, that not safe at all. A good lure for hackers, expecially if you had an annonymous FTP.

 

But uhh...whatever floats your boat. :D

Share this post


Link to post
Share on other sites

It could work well, but you need to work on the security issues a little more if you dont want hawk lurring down on you through it. Nice though.Cheers!Yasir :D

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.