User Management Code

  Home arrow User Management Code arrow Filebased password check
USER MANAGEMENT CODE

Filebased password check
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2002-01-18

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    A very simple passwordcheck. You can add more security by adding crypto to your password listed in the plain-text file.

    By : ugehrig

    <?php
    // This is your indexfile: index.php
    ?>
    <HTML>
    <HEAD>
    <TITLE>password admin</TITLE>
    </HEAD>

    <BODY link="#0066FF" vLink=#0066FF aLink=#0066FF bgcolor="#FFFFFF">
    <?php
    $logok = FALSE;

    if (isset($login) and isset($passwd)){
    $fp = fopen("password.txt", "r");

    while (feof($fp) == 0)
    {
    $line = chop(fgets($fp,1000));
    $arr = split(",", $line);
    if (($arr[0] == $login) and ($arr[1] == $passwd))
    {
    $logok = TRUE;
    continue;
    }
    }
    }

    if (!$logok)
    {

    ?> <a name=top></a>
    <form method="post" action="index.php" name=loginform>
    <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
    <tr align="left">
    <td valign="top" width="480">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr align="left">
    <td><font size="-2">login</font> </td>
    </tr>
    <tr>
    <td>
    <input type="text" name="login" maxlength=50 size=10 style="width: 90px; font-size: 10px">
    </td>
    </tr>
    <tr>
    <td>
    <input type="password" name="passwd" maxlength=50 size=10 style="width: 90px; font-size: 10px">
    </td>
    </tr>
    <tr align="left">
    <td><font size="-2">password </font> </td>
    </tr>
    <tr align="right">
    <td>
    <input type="Submit" value="login" name="action" style="width: 30px; heigth: 18px; font-size: 10px">
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br>
    </form>
    <?php } ?>

    <?php
    if ($logok)
    {
    ?>
    <script language=JavaScript>
    window.location.href="your_next_file.php";
    </script>
    <?php
    }
    ?>

    <script language=JavaScript>
    <!--
    if (document.loginform) {
    document.loginform.login.focus();
    }
    // -->
    </script>
    </BODY>
    </HTML>


    ***********************************************************

    The next 2 lines will be in your plain-text-file password.txt:
    your_login_1,your_password_1
    your_login_2,your_password_2
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More User Management Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    USER MANAGEMENT CODE ARTICLES

    - XCRYPT v1.0b
    - DB_eSession class stores sessions in a MySQL...
    - Ever Changing Dynamic Passcode Code
    - phpAutoMembersArea - create own members area
    - Azura Signup 2.5
    - Azura Signup 2.0
    - Azura Signup
    - Flexcustomer
    - PHP Quicksite 2.0
    - PHP Quicksite 1.0
    - random string generator (key generator)
    - Example Login system
    - Simple and Easy Security
    - Basic Security
    - UMA - User Management and Authentication

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap