Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    Question Need Login System Without Database

    I want a user login system using a flat files for User Name & Password logging & I dont wanna use any Databases.

    Can someone please write some code with detailed guidelines for me.

    Thanx
    UZAIR

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is so unsecure, people only have to view the flat files to get peoples passwords..

  • #3
    Regular Coder goughy000's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    415
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It can be more secure than first thought if you think about it.

    if the flat files are php..

    PHP Code:
    <?php
    if(header("Location : $_SERVER[PHP_SELF]")){
       exit();
    }

    username:password
    user2
    :psswd
    not sure if that code works but i have seen similar, if the page is accessed directly it wont be displayed. however it can still be included

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    joe:pass
    bob:test123
    PHP Code:
    <?php
    $user 
    "Joe";
    $handle fopen("log.php""r");
    if (
    $handle) {
       while (!
    feof($handle)) {
              
    $buffer fgets($handle);
           
    $sp split(":",$buffer);
           
           if(
    strtolower($user) == strtolower($sp[0])){
           echo 
    "Hi " $sp[0] . ", your pass is " $sp[1];
           }
       }
       
    fclose($handle);
    }
    ?>

  • #5
    New Coder
    Join Date
    Feb 2006
    Location
    Arizona, USA
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Flat files that are plain text can be pretty insecure if someone (hacker) knew where to look.
    But, for example, if you used PHP's MD5er for the password, it's not that bad.
    But if your "database" flat file gets to be very large, it can be a performance issue.

    Have you considered the built-in flat file DB SQLite?
    I mean, it is a flat file in your web folder, with support built-in to PHP. Would probably use less code then using a flat file. As your username/password checks are just single queries versus manually opening a file, reading all the values, searching, etc...

  • #6
    Banned
    Join Date
    Aug 2007
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    check this out http://tinyurl.com/6jnns7, i used it once.
    i say, the demo doesnt work. but the script does, check out the main page of the website, it has the login system nicely integrated, but you cannot register.
    Last edited by I_Love_Privacy; 07-22-2008 at 11:31 AM. Reason: add some text!

  • #7
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts
    You could even use .htaccess to prevent viewing of the file anyways.

  • #8
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    What is wrong with using a database? they are insanely easy to do and very secure.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •