Blog
Simple php login script using SQLite
27. July, 2011 • 10 CommentsHere’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

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.
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
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?
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
Cool! I use Adminer for most of my quick db admin tasks: http://www.adminer.org/. The great thing about Adminer is that it works with SQLite, MySQL, PostgreSQL, MS SQL and Oracle!
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….
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).
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
This is Great… Thank you so much for sharing this its really a huge jump start…
Thanks for the comment and I’m happy you found it useful!