|
|
|
|
![]() ![]() |
Mar 5 2005, 07:30 PM
Post
#1
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 76 Joined: 5-March 05 Member No.: 4,178 |
first off make a login.html page
Code: QUOTE <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: QUOTE <?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: QUOTE $admin3 = "admin3"; // second admin username $adm_pass3 = "password3"; // second admin password Under the other 2 admins names and password and this also: Code: QUOTE || ($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!! |
|
|
|
Mar 6 2005, 02:09 AM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
It'd work, but is it really a good idea to store the admin passwords in an unencrypted file?
|
|
|
|
Mar 6 2005, 05:03 AM
Post
#3
|
|
|
Member [Level 3] ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 91 Joined: 20-December 04 Member No.: 2,823 |
QUOTE(beeseven @ Mar 5 2005, 09:09 PM) Yeah, that not safe at all. A good lure for hackers, expecially if you had an annonymous FTP. But uhh...whatever floats your boat. |
|
|
|
Mar 6 2005, 02:05 PM
Post
#4
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 12 Joined: 6-March 05 Member No.: 4,196 |
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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th September 2008 - 12:04 PM |