Simple php login script using SQLite

27. July, 2011 • 10 Comments

Here’s a simple little php login script I wrote that uses SQLite to store and authenticate usernames and passwords.  Passwords are stored as MD5 hashes and I’ve included a password generator script as well.

Demo: http://projects.bryanmcbride.com/login/login.html
Download: http://projects.bryanmcbride.com/login/sqlite_php_login.zip

 

 

 

 

 

 

 

 

10 Comments to “Simple php login script using SQLite”

  1. mike says:

    this is awesome how you have it. i have downloaded your zip and installed it on my website.

    i am getting errors everytime with this:
    Fatal error: Call to a member function fetchColumn() on a non-object in /home/content/23/7121823/html/yonoob/checklogin.php on line 13

    would you know what this is?

    just thought i would ask.

    thanks for posting this.

  2. Bryan says:

    Hi Mike,

    Sorry I’m just getting back to you on this. Make sure you have the php_pdo_sqlite extension enabled in PHP. Also- what version of PHP are you running? This script has been tested on PHP 5.3.6. Let mek now how you make out!

    BRYAN

  3. Bry Gee says:

    Great script but I am trying to adapt so it redirects the user to its own specific page. I have had a degree of success by making a page for each user based on the user name header(“Location:$user.php”); but if another usser knows other names it is easily cracked. So I tried header(“Location:$hashpass.php”); which directs to a page based on the md5 generated password. What is my best solution for this?

  4. Bry Gee says:

    as a footnote – for user admin purposes phpLiteAdmin is a perfect solution for managing users http://code.google.com/p/phpliteadmin/

    I have a pimped version of this script along with Bryan’s login script http://www.d-sine.com/ig/dbadmin.gif in anyone is interested >> http://www.d-sine.com/download.php?f=sqlite_php_login-custom.zip

  5. Bry Gee says:

    I found Adminer after my pimping of phpLiteAdmin grrrr lol, but couldnt get my head around their form setup anyway – very confusing (and it seemed I wasnt the only one). Their editor is good but I will most probibly do a stripped down version of PLA for client use. (Obviously posting the result on here if allowed)

    Just need to sort the redirect problem now….

  6. Bry Gee says:

    I have finally finished the client version of Bryans Script with a few enhancements see http://www.d-sine.com/ig/dbadmin.gif. The admin area is a lot easier to use and a step by step users guide for setting up the script is included which should cover everything. The Admin area works fine under normal conditions, but does get a little quirky under some tasks like ‘multiple delete’, something you can easily live with.

    I take no credit in this script and agknowledge all scripts used in this project, along with their authors in the user manual, especially Bryan. All scripts are licenced under the GNU General Public License (assuming this one is too).

  7. Srabon Hasan says:

    you rock man :) .. exactly what i wanted to have :) .. hope one day i can buy you a cup of coffee for this :) … greetings from Bangladesh :p

  8. Your Biggest Fan... says:

    This is Great… Thank you so much for sharing this its really a huge jump start… :-)

Leave a comment