mtWeb  Home > Download > PHP Login ScriptSitemap  Search

PHP Login Script

Posted by martin on 20 Sep 2002.

A complete PHP login script; includes user registration, login, logout, change password, change member details, and user list.


  • Prevents session stealing by verifying session data on every request
  • Remember-me cookie doesn't include the password at all, thus network sniffers may only log in as you but not change your password


php-login-script.tgz, downloaded 17888 times.
Complete code as gzipped tarball [6KB], downloaded 32767 times.
Complete code as zip archive [11KB]
php-login-script.sql, downloaded 19085 times.
Database schema
user.php, downloaded 31504 times.
User class
signup.php, downloaded 16275 times.
Sign up page
login.php, downloaded 32493 times.
Login page
logout.php, downloaded 11353 times.
Logout page
password.php, downloaded 17765 times.
Password change page
edit.php, downloaded 7523 times.
Member details edit page
list.php, downloaded 6711 times.
Member list page
details.php, downloaded 6061 times.
Member details page
index.php, downloaded 9816 times.
Member home page
functions.php, downloaded 8122 times.
Functions library
global.php, downloaded 9036 times.
Global page handler
session_defaults.php, downloaded 7609 times.
Session defaults



by Del ( on 4 Oct 2002 6:52am GMT

I'm a novice, but my hosting company gives me MySQL and I have successfully loaded the schema and uploaded the php files to my server. What else do I need to do to make this work? Or am I out of my league here? All the php files generate the same error:-

Fatal error: Call to undefined function: begin_html() in etc etc



by martin on 4 Oct 2002 10:41am GMT

Del, it is a function that writes the HTML header of all pages - the top breadcrumb and links. Just define something for yourself.

an error occurred
by Sauli Karhu () on 5 Oct 2002 9:20pm GMT

Very nice pages! I tried to download the PHP login stuff, but it says "an error occurred"


Everything works for me
by martin on 6 Oct 2002 12:15pm GMT

Sauli, everything works. This error may have been caused while I was updating the site because some files get temporarily unavailable.

Same as Del's
by Kevin ( on 18 Oct 2002 8:35am GMT

I don't understand. I receive an error stating

Fatal error: Call to undefined function: begin_html() in /home/sites/site41/web/cgi-bin/login/signup.php on line 4.

What do you mean just define something for yourself, any help I could get would be great.

Include global.php
by martin on 18 Oct 2002 10:38am GMT

Just include global.php, it is defined there.

Novice like Del
by Michael ( on 19 Oct 2002 12:48am GMT

hi, im a complete novice when it comes to php so im stuck in same place as Del is with the :-

"Fatal error: Call to undefined function: begin_html() in F:\webspace\techie\ajohnson\\www\login\index.php on line 4"

i went in global.php and see the 'Enter your template head here' bit so i tried adding html in it and it didnt seem 2 work. Can any1 give me (and Del) some help or tips plz. Or email me at with your global.php file so i know whre im going wrong. Thanx

Template header
by martin on 19 Oct 2002 11:03am GMT

Here's an example header:

function begin_head() {




<title>My Title</title>





still nothing
by Michael ( on 19 Oct 2002 3:13pm GMT

it now says the following :S

Fatal error: Failed opening required 'DB.php' (include_path='.;c:\php4\pear') in F:\webspace\techie\ajohnson\\www\php-login-script\global.php on line 13

by martin on 20 Oct 2002 8:12am GMT

Ooops, I forgot to add PEAR DB to the dependencies list.

begin_html() not defined
by Joe ( on 26 Oct 2002 6:45pm GMT

begin_html() is definded in the global.php, which apparently is expected that it will load itself automatically... Mine doesn't, so I had to require_once it in each php file. I presume there must be a way to automate that, but I couldn't find any resource to tell me how. I've only been playing with php for the last 18 hours though... :)

by Montreal ( on 28 Oct 2002 1:50pm GMT

There's a require once in global.php looking for config.php, what have I missed that it's not anywhere to dl?

Here's config.php
by martin on 28 Oct 2002 3:16pm GMT

Here's config.php.

Also read how to create a PHP login script.

PS. This is not meant as a download-and-use script, you'd have to customize it for yourself first - define your templates and decide how to integrate it with your code. I'm really sorry if people believe they can use it right away.

some error
by toko ( on 31 Oct 2002 5:07pm GMT

Can any body tell me how to show this error?

Fatal error: Cannot redeclare format_datetime() (previously declared in /home/truong/public_html/studies/login/functions.php:25) in /home/truong/public_html/studies/config.php on line 33

Do it once
by martin on 31 Oct 2002 7:17pm GMT

Use require_once or include_once instead of require/include.

Same as toko
by andrewchk ( on 3 Nov 2002 3:42pm GMT

The codes in the global.php is include_once / require_once already, but still got the same error as TOKO's

Fatal error: Cannot redeclare format_datetime() (previously declared in /home/public_html/login/config.php:33)

Mixed files - old and new
by martin on 4 Nov 2002 10:00am GMT

Sorry Andrew, it's my mistake. The config.php file is old, I've moved the format_datetime() and format_date() functions to function.php. You just need to remove the function definitions from config.php.

by SlaYa ( on 4 Nov 2002 9:02pm GMT

hey is there a readme or a manual tht comes with this cuz i keep etting the error " Fatal error: Call to undefined function: begin_html() in /home/virtual/site23/fst/var/www/html/login/index.php on line 4 " and i did tht header thing u said to add in global.php and im all lost....

i got an idea
by danny ( on 5 Nov 2002 1:54am GMT

i got an idea, how about make a login/signup script that works and is easily installed? GEEE!

by SlaYa ( on 7 Nov 2002 7:59pm GMT

this script takes sum1 smart enough to actualy make a script like this to edit.......

ya holy shit
by Strife () on 7 Nov 2002 10:20pm GMT

how bout a guide

by snoop () on 8 Nov 2002 4:27pm GMT

how bout learn php and write your own code instead of complaining about not having a tutorial on how to do every little thing

Signup for Webmail
by Moudy ( on 10 Nov 2002 11:34pm GMT

I am trying to have the users sign up for a new email instantly ? Will your script do the work ?

Re: Signup for Webmail
by martin on 12 Nov 2002 12:15am GMT

Moudy, this is not a plug & play (pray) script. You have to customize it for your specific needs, if you don't understand how it works I don't recommend using it.

Love it...
by Ryan ( on 12 Nov 2002 5:49pm GMT

Love the script...its great, already customized it and everything. One question maybe someone...not necessarily martin has to answer. Within the "protected" area, I also have a higher protection based area that only certain users can access. Anyone know how I can only allow certain users to have crudentials to also access that area?

hmm, configuration question
by Alex ( on 15 Nov 2002 4:33am GMT

Hey, probably it is offtop, but how you did virtual directories refer to php (like /detail/ to /detail.php) using Apache web server?


by DarkestNight () on 15 Nov 2002 3:04pm GMT

This script requries loads of modifications. I couldnt get it working.

Tip: make your software work before uploading it as a "working" version

hmm simple question
by Tom Yates ( on 19 Nov 2002 6:38pm GMT

what is the contents of Db.php, the config file points to it, but i don't have it.

Cheers Tom

Permission levels
by martin on 20 Nov 2002 8:14am GMT

Ryan, just add a column in the database like permission and register that as a session variable. Then you can check it whereever you need to.

where to get 'HTML/Table.php'
by Lee () on 20 Nov 2002 9:46am GMT

where can i get the Table.php for the toHtml() function?

by AnriCO () on 22 Nov 2002 6:29am GMT

Fatal error: Call to undefined function: setfetchmode() in /home/u1307/domain/ on line 16

The same error
by T-RaiNeR ( on 22 Nov 2002 8:34pm GMT

Fatal error: Call to undefined function: begin_html() in /home/gamehacking/signup.php on line 4

Ummm...suggestion :

please try and give a full example...plz

i don't know where to put that the example header you please do a full example, it'll help a lot

by gordon hickam ( on 23 Nov 2002 1:32am GMT

I'm using MySql as a database backend.

Anything special to get the php-login.script.sql to work?

Or should I just create the tables manually?

The same error
by David ( on 26 Nov 2002 4:10am GMT

Go to your php.ini file and find this

line: register_globals = On.

Many scripts will not run if this is set to off.

by Ryan ( on 27 Nov 2002 3:07pm GMT

Yes, I also need Table.php...

How do i include global.php
by Coodiss ( on 28 Nov 2002 2:20am GMT

Just include global.php, it is defined there.>??????????????????????????????????????????????????????????????

WHAT!! i tryed



i know c++ and java not php :\

Redirect?? whats wrong...please help!
by Ryan ( on 28 Nov 2002 5:33pm GMT

I get this message:

Fatal error: Call to undefined function: redirect() in /home/nhsband/northgateband-www/TEST/login.php on line 5

I'm almost done configuring this!!

by pancho on 2 Dec 2002 1:27am GMT

Can any body tell me how to show this error?

Fatal error: Call to undefined function: redirect() in /home/nhsband/northgateband-www/TEST/login.php on line 5

by Warvstar ( on 2 Dec 2002 11:09pm GMT

Im only 2 days into this stuff, but i got most of it, i just need a few pointers.i got all the files you have for download on your site plus PearDB. but iam having a realy hard time trying to access these scripts from my browser. heres an example. When i try to access a .pl or .php file in IE. It just asks me if i want to open the file or save to....

Thats all hope you can help

Tis Wank
by TehPropheT () on 4 Dec 2002 9:38am GMT

Why publish something with NO manual/user guide to configure the script? I thought your main intention of publishing a script like this would be to so people could install and use it. Obviously no one can ^^. Had no good comments i see about people praysing it, just stating how wanky it is tbh.

From one PHP scripter to a Newbie PHP scripter.

by Frank Cristaudo ( on 7 Dec 2002 4:06am GMT

I continually get this error (Call to undefined function: pusherrorhandling() ). I just upgraded my server to PHP 4.2.3 and PEAR was installed correctly and everything seems to work except for the signup.php file? Any suggestions?

last message
by Frank Cristaudo ( on 7 Dec 2002 4:25am GMT

sorry about the last message, i was not setting error in global..

really enjoy the code...learning how to work with PEAR...Thanks

Config file?
by Sponse ( on 14 Dec 2002 4:09pm GMT

Why diden't u include all files needed for this script ? i'm no wiz php coder :D

so i dont know how the config shall be set up could you tell me how?

by R. Rajesh Jeba Anbiah ( on 17 Dec 2002 12:34pm GMT

Kudos to Martin for the great work. AFAIK, this is the only source on the net to deal login process. Really great work!!!

I've one question: Will global.php be automatically be called? In other words, should we include global.php?

by Josh ( on 17 Dec 2002 10:38pm GMT

I don't have a Begin_HTML.php in my /usr/share/pear/ dir. All my files include:

















---Which of these files should I call instead of Begin_HTML.php???

please help :) e-mail me or post here

by R. Rajesh Jeba Anbiah ( on 18 Dec 2002 7:33am GMT

Hi Josh,

Begin_HTML is a function that Martin has written in global.php. So, please check it in global.php. And before that, pls download the zip file.


R. Rajesh Jeba Anbiah

yess the same error
by unta () on 20 Dec 2002 3:57am GMT


okey i'm idiot..

same error when first time install it.:

call to undefined funcition: begin_html ()

can anyone give an example (not give solution to master php).

Martin , you are a good guy because create this php, but i hope u coniser give an example in your coding ..

remember, there are alot of idiot person outthere... including me

fatal error
by Fenixas ( on 28 Dec 2002 12:31am GMT

I'm getting this error message:

Fatal error: Call to a member function on a non-object in /usr/home/fenixas/www/login/index.php

by Erik () on 28 Dec 2002 11:14pm GMT


by bram ( on 30 Dec 2002 8:36pm GMT

Have i put:






then php script



and save as html or php?

by bram ( on 30 Dec 2002 9:02pm GMT

Fatal error: Call to undefined function: begin_html() in c:\phpdev\www\index.php on line 4

what to do?

is it working?
by george () on 3 Jan 2003 5:14pm GMT

does anybody has this script actually thing working?! it looks like a great script, but like many others i dont get it to work (im pretty stupid when it comes to php)

RE: Save
by R. Rajesh Jeba Anbiah ( on 8 Jan 2003 4:59am GMT

Hi bram,

You should save it as php!


R. Rajesh Jeba Anbiah

RE: error
by R. Rajesh Jeba Anbiah ( on 8 Jan 2003 5:00am GMT

Hi bram,

begin_html() is defined in global.php and so include global.php in your file.


R. Rajesh Jeba Anbiah

by BEBE () on 8 Jan 2003 10:21pm GMT

Martin there is too much errors on that script, update it......

by Freak ( on 11 Jan 2003 1:28am GMT

Fatal error: Failed opening required 'lib/user.php' (include_path='.:/usr/share/pear') in /home/moslim/ on line 8

ive got my global.php correct but what is this???

PHP and mysql are nog installen on a local computer, i host somewhere...

and i also dont have PEAR DB, can i do something to make tis work?

PHP Godsend?
by elixir ( on 13 Jan 2003 8:10am GMT

I started working with PHP this past Thursday, for only a few minutes at a time since Im a working mom & wife, this means I have family to deal with as I'm sure many of you do.

I have swam, surf and scoured the internet for PHP info ince last Thursday, never heard of it till last week.

Last time I did any codes, it was 1984.

(other than HTML, CSS)

I learned how to customised these scripts all by myself, as they say, we all learn by trial and error.

The education is available, the scripts are here, How much easier can it get?

Possibly have Martin come to your house and put the codes in place for you?

If this is possible, Martin your invited to my home!!!!

Damn Good work there, wish I knew how to program!!

Your a Godsend!!!

explain this one
by () on 13 Jan 2003 8:52am GMT

How do u Open the php files?
by emg () on 14 Jan 2003 9:31am GMT

How do you open the php Files, do u need a special program, Im trying to make a login feature on my website, But i dont realy know how to use php

if some one could help it would be great.

PHP file editing
by Cal ( on 16 Jan 2003 6:43pm GMT

emg... you can use any text editor to edit a PHP file. If you need more info view to learn the basics.

Shu eden zatlarynyz yaman govi bolupdir
by Guvanch () on 21 Jan 2003 9:11am GMT


Salam hemmnize

hi everybody

this page and also this this web site is very good for beginners in php

by pear () on 22 Jan 2003 6:50am GMT

how can i tell if my server already has Pear::DB installed?

thanks in advance

by P4R4H4T () on 22 Jan 2003 7:52am GMT


How to get this to work...
by Lars ( on 22 Jan 2003 4:38pm GMT


I tried to get all this to work but (as I'm new tot PHP/MySQL) I have no idea how to start... I did manage to get PHP & MySQL up and running...



Pls. (Also)Reply to me personally

by sugi ( on 23 Jan 2003 7:44am GMT

i'm download ..extrax .. d://localhost/index.php--> i not have begin_html(); ..command ERROR u have all.html example begin_html()... thanks ...

by royjn ( on 30 Jan 2003 12:14pm GMT

Fatal error: Failed opening required 'global.php' (include_path='.;c:\php4\pear') in c:\apache\http\user\signup.php on line 3

where can i change the path c:\php4\pear ???

reply to error
by kevin () on 2 Feb 2003 6:32pm GMT

you can't use mysql with apache unless you've already installed it

but the reason your getting this error is because you have t o edit your httpd.conf file and set the path for php

by Achi ( on 4 Feb 2003 1:04pm GMT

I've downloaded DB and PEAR. What should I do with this error:

Call to undefined function: setfetchmode() ... /config.php on line 17

witch says:


What is wrong ?

register login ....
by abdi ( on 7 Feb 2003 12:39pm GMT

i would like to get help creating a small aplication using php msql and appache server, the suer would register then log in then he/she would view a small play e.g song,chat and postmessages. please help

Fatal error: Call to undefined function: begin_htm
by afandi ( on 7 Feb 2003 3:13pm GMT

i found that errmsg when i try to load index.php what's wrong. pls help

begin_body() in global.php
by afandi ( on 7 Feb 2003 3:28pm GMT

Parse error: parse error in c:\phpdev\www\database\logon\global.php on line 51

i try to load index.php but this message come out. pls help me????

Enter your template head here

Fatal error: Call to undefined function: begin_body() in c:\phpdev\www\database\logon\global.php on line 18

by WinDzoR () on 7 Feb 2003 5:34pm GMT

Fatal error: Failed opening required 'html_form.php' (include_path='.:/usr/share/pear') in /var/www/windzor/heroes/login.php on line 8

comes when i try to open login.php. But am i opening it right or do i need to make another page with the login? And where is it in what file you make the page that logged ind users are redirected to?

by Max Web ( on 10 Feb 2003 9:46pm GMT

Fatal error: Cannot redeclare format_datetime() (previously declared in /home/max/public_html/community/functions.php:25) in /home/max/public_html/config.php on line 33

Whats wrong?

Sounds great...
by Guntius ( on 14 Feb 2003 11:33am GMT

At first sight this script sounds great to me... though I still haven't tried to customize it (I'm sure it'll be a hard work, because my needs are really specific. I can't use MySql cause I must work on a different DataBase).

Just a suggestion... how about to add some more comments in your code?

I think it would be much more clear and easy to customize.


Including the definition of a function and its parameters, the meaning of each parameter and the expected result/behaviour of that function.

The same for classes and methods/properties.

You're great! Keep up the good work.

I have the following errors
by Chapi ( on 14 Feb 2003 1:48pm GMT

Fatal error: Call to undefined function: setfetchmode() in c:\web\user\config.php on line 16

I can bypass this if I comment out



in config.php but then get the next error.

Fatal error: Class html_table: Cannot inherit from undefined class html_common in c:\web\user\HTML\Table.php on line 32

Help would be great!



by Man () on 18 Feb 2003 4:36am GMT

I followed the trail of errors and finally i got stuck here. It says

"Fatal error: Dynamically loaded extensions aren't allowed when running in SAFE MODE. in /users/ on line 11" This is the first php i'm working with, remember. Do i hav the wrong file, or should is it a problem with my server?

"Safe mode"
by Man () on 18 Feb 2003 4:37am GMT

what do i do about pear.php "safe mode" error?

please send me the login script
by niklas ( on 19 Feb 2003 10:57pm GMT

Is there anyone that can send me the full php-login-script that works


by Norse ( on 27 Feb 2003 3:43pm GMT

leet scipt!

all that code that says...
by all that code that says... () on 27 Feb 2003 5:09pm GMT

all that code that says a undeclared function or parse error or etc..make sure you checkk to see if you support that version of php, if the php script was writting for 4.1.0 and u have 4.0.0 then it isnt going to work because your hosting company php engine will only declare the new functions...

try this snippet;


// Show all information, defaults to INFO_ALL


// Show just the module information.

// phpinfo(8) yields identical results.



by Raj ( on 7 Mar 2003 10:18pm GMT

I downloaded the .zip files but how do i setup my host has MSQL and suports PHP please help i am new to this php

very hard
by g0liatH ( on 8 Mar 2003 6:37pm GMT

i guess i first have to learn php be4 i can use this script :(

very hard
by g0liatH ( on 8 Mar 2003 6:38pm GMT

i guess i first have to learn php be4 i can use this script :(

php asp tutorials download
by shafique shaikh ( on 12 Mar 2003 9:55pm GMT

collection of tutorials of asp and php

i mastring in asp & php and you send the notes on my email add


And then what?
by ian davila ( on 20 Mar 2003 7:27pm GMT

I download the script, but & then what i need to do

by ian davila ( on 20 Mar 2003 7:29pm GMT

Do you have an example of this script online?

Fatal Error - Help me!!
by JW ( on 22 Mar 2003 2:58am GMT

There is this error :

Fatal error: Call to undefined function: begin_html() in /home/c1e340/public_html/php-login/index.php on line 4

I tried to open the file, but i don't see anything to edit. I hope someone can help me out with this. Thanks

by wiking ( on 23 Mar 2003 6:02am GMT


I want A lot of help
by SysTeM (JaMaL@FreeJavaHelp.Com) on 26 Mar 2003 2:59pm GMT

Well i want your help in the php if you don't mind

if you have msn messenger add me thanks dear

by Darth ( on 30 Mar 2003 5:46pm GMT

I have just started with PhP and my question is:

When i am viewing the login.php file it says

Warning: main(html_form.php) [function.main]: failed to create stream: No such file or directory in C:\webroot\Login\login.php on line 14

what am I supposed to do? Please answer here or email me.

it doesnot work.....
by cador ( on 31 Mar 2003 7:46am GMT

nothing works in this script...

not good

What´s up.
by Sebastian () on 3 Apr 2003 1:03pm GMT

I´m from Argentina, and I download the scrip. I don´t speak english very well, but this scrip is a yet. It doesn´t work, and all the file are incompletes. Thanks. NO WAR!!!

by Pula Belita ( on 7 Apr 2003 7:50am GMT

This script sucks`s.

Fuck this script.

For one Week I try to install it and dosen`t` work. Sorry for my bad english.

I am from Romania.


by R. Rajesh Jeba Anbiah ( on 8 Apr 2003 12:07pm GMT

This is a great work. AFAIK, this is the only available PHP script that explains how to code login module (with sessions). This is just a sample script. You certainly need to work further.


R. Rajesh Jeba Anbiah

Is there an updated zip containing all(new) files?
by Squall ( on 8 Apr 2003 8:48pm GMT

Great Script Martin, i really look foward to using it. Is there an updated zip with the new config.php and all the rest of the files?

hello Martin!
by Anonymous on 11 Apr 2003 8:22pm GMT

Do you know how I can fix the error: "Undefinded variable: filename in /home/httpd/html/user/details.php on line 8"?


by winga ( on 15 Apr 2003 12:52pm GMT

while running logged.php file I get this error,

Fatal error: Call to undefined function: uri_self() in c:\phpdev\www\winga\logged.php3 on line 9

Please help me

by Aston ( on 15 Apr 2003 6:20pm GMT

The world looks to be filled with dumbasses. Give Martin a break. It's not like you paid for the script. Like he said if you can't figure it out, don't use it because it's over your head. If you can't speak proper english then don't speak.

martin not here...
by () on 17 Apr 2003 3:24am GMT

Seems like martin has not come to the board in a while, but if he is, please let me know what I need to know to figure this out...

by Me () on 17 Apr 2003 10:22am GMT

its obvious this is crap, assuming 38 ppl had trouble putting this shit to work.

by caelestis () on 21 Apr 2003 4:05pm GMT

works great... i assume the 40 or so people that couldn't get it to work are completely fucking stupid... thanks...

by stefan ( on 22 Apr 2003 11:36am GMT

Where can i find table.php ??!

From FTP:// to Http://
by Jelle ( on 25 Apr 2003 6:07am GMT

i have a FTP server , but i need an http:// adress, because i want my database to work....can anybody help me with that?

these ppl have no conscience...
by the_dukester () on 26 Apr 2003 1:59pm GMT

u ppl make me completely f*cking sick.This guy gives up his spare time, makes a great website, gives away FREE scripts which he's programmed in his own time, then u have the cheek to flame him coz u're too stupid to get it to work. I've been involved in the Open Source community for a long while now and whilst i appreciate that the influx of ppl to open source projects is always good, i can't stand this new 'fashion' amongst certain newbies who are more interested in criticizing than providing constructive comments. Something you learn pretty quick in the open source community is: if it doesn't work for you, write it yourself.

Keep up the good work, Martin.

by :)josh ( on 27 Apr 2003 1:06am GMT

thanks i like i hehe i modified it loads and now have profiles :P thx

What the f**k is this???
by Moonlord () on 30 Apr 2003 2:01pm GMT

The .zip file is empty and then you have to download parts of this script from other sites. Is is so difficult to put all that stuff in one .zip file?????

by Guest () on 15 May 2003 6:20am GMT

Does this login script include personalized redirects for users? In other words if Joe logs in can he be redirects to Joes Pages and not Johns?


by Dziodas ( on 22 May 2003 4:42pm GMT

Martin, I suppose you wrote this script for non-beginers. So beginers should try someone else or to ask martin to write a full script with a html file.

Annoying, but 3/4 working
by Shane ( on 23 May 2003 12:09am GMT

OK, I got most of this thing to work minus some odd ball behavior I am still working out (and may never figure out). Not sure what he is doing in certain areas, but that is due to the lack of commenting and proper documentation. Sure, I will figure it out, but it is time consuming. Add to that, the tar doesn't even retain directory structure relating to how he has the scripts configured by default. You will need to go through the code and deal with that on a per file basis. :) That is more annoying than difficult to fix. I am by no means a newbie at this stuff, but even I am having problems with getting this to work completely. Lack of commenting certainly doesn't help which is poor coding style. Don't take that personally Martin, just sayin. ;) THIS SCRIPT SET IS NOT FOR PEOPLE WHO DO NOT KNOW WHAT THEY ARE DOING! You can flame me if you want, but I do this for a living. ;) Commenting as you go not only helps others, but the programmer him/herself. Granted this is a small script set so it really doesn't matter I guess. Anyway, to answer some questions. Table.php and Common.php is available from You will need Table.php and Common.php (Table.php needs this one) to make this work. At least Table.php has a require statement for Common.php. Make sure to throw them in to a directory named HTML (if you go by defaults). If you leave his code as is, you will also need to write a handy function that is called redirect(). He uses the function, but does not included it anywhere. Once you get moving along, you will run into this. Just to make my life easier right now, I turned on output_buffering (php.ini) and used the following in functions.php:

function redirect ($redirURL){

header ("Location: $redirURL");



Now.. this is in no way ideal and you can turn off buffering in the ini file and use output buffering functions. I just did this as a temp solution for now.

The rest takes time and patience. Lots of coffee and a few breaks to get out your frustratins. Experience is also a plus. Thanks Martin for a great login, but I have to admit not being you makes it tough to get it working completely. :) Just very time consuming. A complete working model that is downloadable would definitely smooth things over. If you ever get time, I highly recommend it... or at the very least someone should write a step-by-step guide. Downloadable working code would be more ideal in the end. :) Hope this helps some of you having problems with Table.php and (eventually) Common.php. Also the redirect function which I think Martin explains in the FAQ so check that out too!!

Again, great job Martin. Been looking for something like this for some time. I am new to the login process so it was a great help to get me in the right direction. Take care all!

Oh yeah
by Shane ( on 23 May 2003 12:15am GMT

Make sure you guys pay attention to the dependencies. They aren't there for the hell of it! ;) Martin was pretty clear on that so make sure you guys are reading his documents. Anybody gets this completely working... drop it on a web site for others and take some of the work off Martin. If I get working, I will do that.

Great script
by Ace ( on 24 May 2003 12:53am GMT

Great work, Never mind the dumbasses!!!

Thank you....
by Virre ( on 24 May 2003 11:11am GMT

Thank you for this script as I have looked for something like this to make a functional login script for a page I have been trying to developing.

Really people should get the fact that this is just a script to learn how to do it and not a solution to there problems.

(my only problem as far as I see it is to get my functions to check if loged in but that I think i could do)

by Adam ( on 27 May 2003 5:38pm GMT

I haven't got a clue!

I downloaded ''


I am a completly beginner to PHP.

I've got Studio MX if that helps!

Please help me...

Yes, this is not for the new/meek at heart
by Dan ( on 29 May 2003 6:15am GMT

Like Shane pointed out, this is not a download and run script. Then again, reading back into the history, Martin said as much. So, Martin gets points for being upfront, Shane for his suggestions on better coding docs. I am wading through this now and, if I get it done soon, I"ll post what steps I took.


Just now, I have things complaining about non-existent classes which makes me suspect there's a lot more assumed to be in the background than, say, your basic Linux box has. We'll see.

Nope, sorry
by Dan ( on 29 May 2003 6:42am GMT

Even loading in the Table and Form support off freshmeat (which defines the elusive Form class), this isn't worth it. Nice effort but, in the end, if something is to be usable by the general community, it has to be more easily implemented. I'm not asking for kid gloves but after I found myself downloading and modifying my system for the third or fourth time, it felt to....Microsoft-ish. (Here a driver, there a form, everywhere another download.) I would have as much as I do now had I started on my own, which now I will. Thanks for the effort, Martin, better luck in the future.

this script
by GregA ( on 29 May 2003 5:17pm GMT

I'm sorry, but this script is not very good. It has good intentions, but requires too much playing around with to actually work. By the time you're done, you might as well have written it yourself.

by orbit ( on 2 Jun 2003 3:53am GMT

All i got to say is when someone takes there time to make something for others it is a great deed and should be looked at as such. (Thank you Martin)

My question so far is this error: Fatal error: Call to undefined function: uri_self() in /home/krypto/www/login/login.php on line 9

If anyone can help on this matter great if not i'll do my best to keep trying and if i get it working great if not i'll be back looking for an updated version sooner or later. Coders should be given respect!! If it wasn't for them you wouldn't be here to begin with.. -=orbit=-

What are these retards talking about? This is easy
by Zak ( on 6 Jun 2003 8:34am GMT

I have about as much knowledge on PHP as Homer Simpson has on advanced calculus, and I got this thing to work. If you can't do this, maybe programming isn't for you.

by Richard () on 10 Jun 2003 1:05am GMT

Hi Orbit and others, to get past the uri_self() error you need to add: require_once 'global.php'; to login.php.

then you will need to get config.php from here:

and ensure that: require_once 'config.php'; is in the global.php file.

Edit the config.php file and remove format_date and format_datetime functions as these are also in function.php. I am now getting: undefined function setfetchmode but i guess i will fina way around that soonish... if u already got the answer then let me know.

setFetchMode found
by Richard () on 10 Jun 2003 1:50am GMT

Found it. SetFetchMode undefined function error will occur when database connect fails.

I would add code something like: $db = DB::connect($dsn);

if(DB::isError($db)) {



This means that if a database connection cannot be made, the php script will end here... probably with a nice error message.

just a comment
by Guffy ( on 11 Jun 2003 5:04am GMT

This script is NOT for beginners... I'm not new to php, but for people to get something out of this you have to know what you're doing !!

And if you really know how to make this script work, you know that much of php to make your own script !!...

So my point is. If you can figure out this script, you could make one just as good by yourself !

Whoa i feel bad for this guy...
by Brian ( on 16 Jun 2003 2:12am GMT

I dont know about you all but i really feel bad for "martin" shit all you guys do is give complaints and say hey can you help me and shit your script sux... Dude think about why did you get it in the first place??(TO NOT WRITE YOUR OWN) so dont talk shit to people that try to help you out and Dam give the poor guy a break he can only do soo much. I think he lost intrest in helping you all in about the 3rd post..

Just my thoughts...


just a comment
by IBS () on 26 Jun 2003 7:13am GMT

I download your script without reading comments. I come back to page and I so a lot of negative comments.

Please be so kind and modify the script your self if you are so good, and after ...

martin cms
by smoothwall on 29 Jun 2003 6:12am GMT

Do u have a cms script like ur site? may i have it! ur site so cool, usefull, smart, small size i think :]

sorry for my english.

adi from indonesia.

note : i loss my password to login this site.

by Fern ( on 2 Jul 2003 8:05pm GMT

You guys sure beat up on somebody that tried to give you something for free.

Where is the CONFIG.php ???
by meikel ( on 4 Jul 2003 7:32am GMT

I couldn't find the CONFIG.php and there is a WARNING JUST LIKE THIS :

Fatal error: Call to a member function on a non-object in C:\apache\htdocs\login1\index.php on line 5

???? what happen here ????

by coder ( on 23 Jul 2003 9:49am GMT

Yes the manual for dummmies would be nice, or uptodate code or at least somekind of explanations for each files etc.

Members login script
by Alan Walker ( on 26 Jul 2003 2:16pm GMT


what would be nice is the user does not get access, unyil he is sent an email, that he has to click on to prove that is his email address and also an admin panel to allow access/deny for that user.

Best Regards from Alan

by tjomi4` ( on 30 Jul 2003 4:24pm GMT

all work ;)

excellent job
by fusion_dm on 30 Jul 2003 7:45pm GMT

i don't know why these people are whining so much. i just went through this forum and had my questions answered. but along the way, i see that most people don't spend time to read for themselves and then post the same question that was just answered a few lines above! people are great aren't they!?


go to
by fusion_dm on 31 Jul 2003 1:13am GMT

Go check out the other php login script page. i just left details on how to get the script to work.


redirect page ?
by ketan ( on 20 Aug 2003 10:25am GMT


i have a problem in redirecting page after login on previous page.

when user submit his id and password will automaticly go to previous page..

i have 2 user restriction page..if user want to see this page he ahs to login first and i'm using only one login page for

pl help me.?

answer to Ketan
by Cory ( on 26 Aug 2003 2:07pm GMT

header("Location: weretheygo.php?username=$username&pass=$password");

login script taht does not use pear
by chuck ( on 9 Sep 2003 8:00am GMT

it seems i tried to get this working for nothing.. the site is hosted elsewhere and i dont have access to folder permissions (and wont get access to it in future). anyone know of another login script that DOES NOT USE PEAR?

any help would be gerat

login did not complete
by -dEmEnToR- () on 12 Sep 2003 11:09am GMT

well the script looks turn out fine but when i try to do signup it just stay on 'da same page n 'de info doesn't get into my database can sum1 help me with this

by none () on 14 Sep 2003 5:52pm GMT

I'm just beginning php, I have not a clue about any of it. Now, I know you made the sources up there, but how do you use them? Like where do you put them? I tried the sign-up code on one of my pages, and it just shows up as the code writing... What am I doing wrong?

by -None- () on 14 Sep 2003 6:43pm GMT

Ok, I downloaded, then upload the files to my webpage. Now what? Yeah, I know I'm just beginning with php, and very confused...

by dana ( on 18 Sep 2003 3:00pm GMT

hai.. i'am from indonesian

transfers php nuke for email

Where do the global.php initialize?
by Anders () on 22 Sep 2003 3:15pm GMT

Hello, i have read and read this code and cant make any sense of the files. The index.php, which i figure is the most sense to launch first, theres no require or include statements at all.




I see that in global.php theres some definitions, not global though:

$user = new User($db);

I just cant see how the $user variable can be reached in the index.php. Also seems that its available in the other files too. This is something i just cant figure out. Please help me. May be some php conf settings, i dont know.

Also would a HOW-TO to make my own login script just using the user.php file which is the "core of this script".

by Ey () on 22 Sep 2003 11:53pm GMT

All the php files in the zip was binary meaning it's just a chunk of code when opened in notepad. I had to use wordpad and copy it back into notepad so it'd be ASCII again. Fix that and all of us notepad users will be happier. :P

Error on Login.php
by Quyen ( on 30 Sep 2003 8:01pm GMT

I am getting this error for the login.php

Fatal error: Cannot instantiate non-existent class: html_table in c:\program files\apache group\apache\htdocs\mass\html_form.php on line 291

I tried to look for the HTML/Table.php

but I couldn't find anywhere in the zip file.

Please let me know where I can find the HTML/Table.php file.


excellent code
by Alana ( on 2 Oct 2003 3:21am GMT

your code is excellent. thank you so much for taking the time to share it; very cool..........and very good.

by josh ( on 4 Oct 2003 1:29pm GMT

can u help me upload a script to my website account?

i don't know how to do it...

i've emailed u the password & the account name...

This is bull shit
by phpsharma () on 10 Oct 2003 8:14am GMT

DOn't depend on others

Fatal error :)
by Vlad () on 10 Oct 2003 2:00pm GMT

Fatal error: Call to a member function on a non-object in /var/www/html/asd/index.php on line 6

What's that? I've seen the files, but some things are... strange.

Does someone know whu that happened?

I just took the files and uploaded them into my server. Then I deleted all that had to do with the html_begin() function ('cause that was another error), and afterwards I got this error.

Please help!

mail at
by Sobhan Pal ( on 14 Oct 2003 9:51am GMT

Script working
by nabidur ( on 17 Oct 2003 8:57pm GMT

Hay..Can anyone help us, who don't get the direction to work with this cool script? plz help us martin....:'(

can someone help me with this
by nick () on 18 Oct 2003 7:20pm GMT

Warning: main(): open_basedir restriction in effect. File(/config.php) is not within the allowed path(s): (/home/penguine:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/penguine/public_html/userlogin/global.php on line 6

Warning: main(/config.php): failed to open stream: Operation not permitted in /home/penguine/public_html/userlogin/global.php on line 6

Fatal error: main(): Failed opening required '/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/penguine/public_html/userlogin/global.php on line 6

anyone got it working all the way?
by wally () on 20 Oct 2003 5:19am GMT

anyone want to zip up a working copy of this script for download...?

help me
by Roland ( on 22 Oct 2003 11:44am GMT

je suis hyper novice en PHP et je ne comprends pas comment implémenter ce script sur mes pages, j'ai créer les tables mais après je suis perdu... personne ne saurais me faire parbvenir un zip de ce script installé ? ou m'aider via email ou msn THX in advance

Very Difficult, But Works!
by Dave ( on 25 Oct 2003 9:14pm GMT

This script does work but it needs alot of work.

I have been coding php for 4 years and know a fair bit however the layout of this script is all wrong.

It took me sevral hours to get this working and it's still not 100%

Unless you realy know what you are doing there is no chane of getting this to work.

I suggest the entire script be rewriten using proper formating and commenting.



release new!
by darktown ( on 28 Oct 2003 9:47am GMT

i suck at php, and tried to get your code and implement it but i began to read this forum and there are SO MANY mistakes, details you forgot! didn't you test?

could you just release a new version that works from the beginning, define your own html begin and more ...

please mail it to me, or release it here on the site


Let's hold competition!
by Coder-X () on 28 Oct 2003 3:56pm GMT

Let's hold competition: who's going to make _working_ version of this code and release here link to it's source code fastest? We are defenately having vast of attendance and interest of not just who is going to win, but _when_ we all are going to get the price: _working_ login script. Ready..steady...GO!

what a waste of time this was!
by stuart () on 14 Nov 2003 10:30am GMT

what are you trying to do here martin? confuse people senseless? i have been using PHP for a while now and was looking to find some of the best Login scripts out there, i canme across this page and thought, ooh, lets have a looksey, what a load of fucking shite, how can you say it is a working downloadable script eh? from the word go, it is a bag of shite, with references to files missing, not icluded, not even defined, what are you? not normal thats for sure, for fuck sake, take the scripts down, MAYBE YOU COULD ACUALLY TEST THEM BEFORE OFFERING THEM FOR DOWNLOAD!!?? idiot. i hate to think how annoyed some of the newer people to PHP feel after trying to get theire head round it, you twat.

regarding login script
by dilan () on 20 Nov 2003 12:25am GMT

do i need to create a new html_form.php for it to work successful..?? which part of the code or additional work do i have to do for my self to tailor it to my needs please may you reply to this msg asap thanx

regarding .. this script
by dilan () on 20 Nov 2003 12:38am GMT

Hiya martin.. i have to admit u gave put a great deal of work into this script... but ... some of the files are missin.. i personnally think that.. you should release a new version for this code with all the links workin .. i think most of the people which have commented on this subject will agree.. hope u release a up to date version asap.. take care people

Nice job.
by cair () on 22 Nov 2003 10:13pm GMT

Thanks for your effort. Nice job although it took me some time to make it work. But it's a very good learning experience for a new php programmer like me.

plz help me
by dilan ( on 1 Dec 2003 1:29pm GMT

my email address is

plz can some one help me i cant get the script to work


by to (or@or.or) on 2 Dec 2003 8:06pm GMT

I have spend many ours trying to get this script to work. so I stoped with modifying this script and wrote my own,

mucht better but not for download :-)

So realy put this fucking script offline !!!

This is DUMB!!!
by adam ( on 3 Dec 2003 4:26pm GMT

This thing doesn't help anyone at all!!!

by jon () on 4 Dec 2003 5:59pm GMT

THIS IS really trash. you are an idot, martin.

by truz () on 8 Dec 2003 11:15pm GMT

this is FUBAR... so long fucker

by Max ( on 11 Dec 2003 12:27pm GMT

Stay away from this script!!!

Script that works.
by Max () on 11 Dec 2003 5:13pm GMT

Leave this joker, this is the site you need....

DB Error: not found
by Burhan () on 18 Dec 2003 4:22pm GMT

Hi Martin, Thank you for the script. I was able to run this at my previous server but now I have the known problem about setFetchMode. I have added Richard's script to config.php


$db = DB::connect($dsn);

if(DB::isError($db)) {




and got this error message:

DB Error: not found

I know my database is there and there is nothing wrong with user, passwd, db name and table. What could be the reason for that.

DB Error: not found
by Burhan () on 19 Dec 2003 5:25am GMT

Ok, ok. I found. Although there was no need at my previous server, mysql.php and common.php ( solved my problem this time. By the way THANK YOU FOR THE CODE, MARTIN !

fuck the creator of this script
by fuck this script ( on 2 Jan 2004 8:44pm GMT

don't you know how to document your coding properly you dumb fuck? I've been going through this script for around an hour and it's pure bullshit. You kiddies shouldn't be's just pathetic. You can reply to this post if you'd like, but I"ll never come back to this site to read the pathetic replies you gay teenagers may have written.


DB.php/ table.php
by Nielsjuhh ( on 13 Jan 2004 8:12pm GMT

I have read the qeustions and i still dont understand how to make a clumn in a database.

I'm not very good at php and at making db's so i'm only asking your help.

and then How o i make a Table .php ??

Lots of thanks

Nielsjuhh ( dutch )

fatal error
by belal ( on 15 Jan 2004 8:27am GMT

thanks martin 4 ur efforts

but i see there is some problem with the code.....i've the following error


Fatal error: Call to a member function on a non-object in c:\apache\htdocs\phplog\index.php on line 6 </b>

i hope u can hlp me

the errors are there on purpose
by () on 23 Jan 2004 5:37am GMT

the errors are intentionally there so script kiddies like 95% of the posters here have to actually learn about what they are dealing with before they can use it

d00d u scuk
by () on 23 Jan 2004 5:47am GMT

ha heh ha ha

all of that

all of that time wasted

i got through countless errors

and now NOTHING!


it defies logic but hey, this is computers were torkin bout


Got it working ! woo hoo
by ethan ( on 28 Jan 2004 7:37pm GMT


I have to admit I was a little disappointed at first as logging into my web site was somewhat of an after thought.

HOWEVER, I've learned so much from getting this to work that I'm eternally grateful.

Thanks Martin!

martin's php-login-script
by dboy ( on 1 Feb 2004 5:39am GMT

You know what? This login code is specific for those hand coders guru out there like martin though.

Anyone may try as hard as deeply geting sick headhache to die to make it work out but will never end up to with success.

Simply because noob like me wich runs different mysql engine or php version wont get the same result to make it out work as martin.

Wont forget also the mysql&php configuration it may takes.

I think i will do like snoop said.

Doing my own code and starting at the begnning to gain the paid of this grandiose intellec world of programming.

Good luck any each of you!


Poor Martin
by ZS () on 3 Feb 2004 4:45pm GMT

I feel sorry for you, Martin. Having to put up with all those immature amatures.

I started out with Login scripts making my own, but I was not satisfied because one of the purposes for login scripts were to make them secure. So, I turned to Google and found Martin's script.

Quit dissing Martin and his script, grow up, and act mature. If you cannot get it to work, say that you wish you could get it to work, thank Martin for puting his time into this script, and find one that matches the size of your brain ;)

by TRUCKS2004 ( on 5 Feb 2004 7:05pm GMT


how do i get the config?
by nathan ( on 6 Feb 2004 8:49pm GMT

where is the config, and how do i get it?

Error not seen above
by Skitzo ( on 10 Feb 2004 1:37am GMT

Fatal error: Call to undefined function: uri_self() in /home/stupid5p/public_html/login.php on line 9

I don't undertand
by Cecep ( on 19 Feb 2004 10:13am GMT

i am a beginner in php. i like PHP very much, but i dont understand when i go to: localhost/index.php and then coming like this :

Fatal error: Call to undefined function: begin_html() in c:\apache\htdocs\index.php on line 4

please where can I get to start in the first ?

Trying to help out
by Mike ( on 22 Feb 2004 9:51am GMT

I made some changes to the scripts to try and help everyone out. I posted the changes on my site <a href=""></a> in the hopes that others will help me finish and get them to work.

much simpler login for us dumb folk
by Skitzo ( on 24 Feb 2004 7:57am GMT

I, like many of the people who have visited this page, can't get the scripts above to work, so I found something simpler on another page, of which I will give you the address. However, I must warn you that this particular script is probably not as secure as the one above and currently does not offer the option of allowing users to change their passwords. You have been warned.

by MURDER () on 26 Feb 2004 10:33am GMT


by Alf () on 27 Feb 2004 3:45am GMT

Got the entire program working. Great Job!!!!

Mike, thanks but...
by () on 27 Feb 2004 3:03pm GMT

thanks for your job Mike but I get a Fatal error: Call to undefined function: begin_html() in c:\programz\easyphp\www\login2\user\signup.php on line 4

and maybe there's a line in global.php that should be edited?

require_once '../config.php';

Great site, but this doesnt work...
by NeophyteHeaven ( on 3 Mar 2004 2:11pm GMT

This is great site...but i didnt get the script work (almost a week tried). if anyone got the script work, email me or upload them to webserver. Thanks.

Login Script For Sale
by Cameron Cook ( on 5 Mar 2004 2:48am GMT

I purchased Account Manager Pro for $99.00, and found I did not need it. Its a CGI script that is easy to get working, and offers a payment buffer too. If anyone would like to buy this script from me, it's unused and available for $45.00 second hand, just email me.

Modified Full Distribution of PHP Login Script
by Chris ( on 7 Mar 2004 7:15pm GMT

Hi All,

I have created a full distribution and reorganized much of the code in an attempt to make things a little easier to read. It includes all the necessary files include DB.php and Martin's multipage.php. I hope it helps. You can download my modified version of PHP Login script here:

<a href= target=_blank></a>

Devil Hack
by Devil Hack () on 8 Mar 2004 8:01am GMT

<? echo("Test") ?>

by robin ( on 10 Mar 2004 12:28pm GMT

where do I find the config.php on your website?

where is the table.php
by Mark ( on 12 Mar 2004 7:35pm GMT

Enter your template head hereEnter your template body here

Warning: tohtml(HTML/Table.php): failed to open stream: No such file or directory in /home/pfgpscom/public_html/corp/html_form.php on line 307

Fatal error: tohtml(): Failed opening required 'HTML/Table.php' (include_path='.:/usr/local/lib/php') in /home/pfgpscom/public_html/corp/html_form.php on line 307

I get an error
by Lonely Ranger(Ryan) () on 14 Mar 2004 3:31am GMT

Fatal error: Call to undefined function: begin_html() in /data/members/free/tripod/uk/f/e/l/felinefriendz/htdocs/index.php on line 4

<Enter> once

What do i do?

help on login
by ( on 23 Mar 2004 8:22am GMT

I'm doing some coding fro login script and i'm wondering why is it that when you login to a pc and login to another... the last person who logon on the site will appear to the pc of another person. i used session to do this but how come my login screen is appearing to the other pc. in which the other person in that pc logon using his own account but after a few mins it changed the screen name and thats my screen name.. why sir.


Very Lazy
by () on 24 Mar 2004 3:26am GMT

I have been developing in PHP for more then 5 years and the major problem here is the lack of documentaion. I read a lot of the posts on the site and I hate people that just get so pissed off at noobs. Get off your high horses and help people who ask for it, instead of giving a bullshit attitude to the amatures and telling them to go screw themselves and that only professioanls should even apply. The real truth is all "professional" developers will (and at least should) make a step-by-step toutorial, full with updated version release information. What has been given is nothing. Even some pros may have some trouble getting started, the archive files don't even have a directory structure and all the files need to get it running. If your going to code a script for people to use and/ or modify, then put in some documentation(the instructions on the site need a lot of editing), otherwise if this is just for people that know the language very well, then your wasting everyone's time when all you have to do is tell people how to make their own code from scratch, but don't make lazy excuses like, "this is not a plug & play script. You have to customize it for your specific needs, if you don't understand how it works I don't recommend using it."

Because with the limited information provide very few people are going to know what your talking about.

im with very lazy
by m3rcy () on 1 Apr 2004 10:25am GMT

im with very lazy on this one. everyone starts off noob. and how did u get to pro? through another pro helping you. otherwise no one would know what they doing. everyone gets taught how to do things. even if it is through a tutorial that someone else has wrote. its still the pros teaching. so its not far to insult the noobs like that. but that dosn't mean that its right for the noobs to go off their nut either. theres better ways to do things. why not just leave this site and go find another script?

by I DID IT!!!! () on 6 Apr 2004 3:36am GMT

this script ios for those who couldnt get it to work..!!! i finally got it@! woot email me fort it woot!! it works for all beginners and profeesionalls i even made a set of plug-ins for like member area, download area. and alot of other shitr@!!

Don't try
by Kiarash () on 6 Apr 2004 4:34pm GMT

don't try this code, is not gana work....

Jack ass question - can not find /user/login
by Matthieu ( on 8 Apr 2004 10:54am GMT


It's all good with the script,thanks a lot.

I can load the index.php, but when I try to go to the link ( login) or ( registed), I have an error message page not found.

I know it's a jack ass question but could you hel p me ?



to setFetchMode() errors
by travis () on 13 Apr 2004 3:08am GMT

Hey, y'all were almost there. Just change config.php to reflect the hostname, username, pw, and database name on your server. Thats where I am now. I'm looking forward to getting past the authentication portion of my new site and I think this will help alot. Thanks martin.

by edi ( on 14 Apr 2004 8:59am GMT

how & where i can get HTML/Table.php

can u send me a complete php-login-script but i want it's no error found

getting it to work
by Chris () on 19 Apr 2004 8:53am GMT

Call to undefined function: begin_html()

and what is this db.php were do i get it

nice work
by Sorki ( on 22 Apr 2004 9:03pm GMT

It was not plug & play script, but i got it working after an hour or 2.

Great script martin, keep up the good work!!

To all the complainers: the script works well, it's just you being to lazy ;)

Help Please!
by masum on 1 May 2004 6:44pm GMT

Hi, umm i need a script for an music page? right..where user have to register and become a member to DOWNLOAD MUSIC!!..and stuff? so is there anyway i can get that kind of script??...i want it with php so that they can't find the MAIN URL...want it to be hidden and tottaly with php..and i thought this script is like that too? is it???? b/c i can't make it work if anyone know how i can get a php script...where peps has to become member to download music or play music??? plz help if possible and i'm sorry if this is not the place to ask me this question!! i dnt know where to request that's y i did it here sorrrrrrrrry..!!

Setup instructions
by Joel Nelson ( on 2 May 2004 3:02am GMT

My hosting company provides space on their Linux server. I can use PHP and MySQL with my hosting plan, so this should work. The instructions don't work for me, however, since I'm not actually able to enter code on the server via a terminal -- just FTP and the cPanel web administration interface. I don't have PEARDB but maybe could install it. Do you have special install instructions for me and those with a similar setup? Email instructions to me at also if possible. Thanks and great work!

Need help
by Alex ( on 3 May 2004 1:45pm GMT


I need your help. Could you maybe contact me.



by kaihan ( on 8 May 2004 3:03pm GMT

this is kaihan i wana hack someone

by someone () on 14 May 2004 11:10am GMT

could you open php with your internet explorer from your computer or must you put it to an ftp to read it ?

afz william

writing articles
by Ken Senior ( on 14 May 2004 5:32pm GMT

The distribution of this code is in some serious need of repackaging. You're missing files (e.g., config.php) and as the comments above repeatedly suggest, missing require statements, and include statements.

Change the sql
by 0o0 ( on 17 May 2004 11:14pm GMT

i want to change the sql to access is it posible..

by CY () on 18 May 2004 3:30am GMT

i'm suppose to do php coding for a login page so that if the password or username is wrong then i will display an error message..i have no idea absolutely how to do it. can u pls write out the codes?

by CY () on 18 May 2004 3:32am GMT

u can post the codings here as soon as possible or can mail to my account at


HI Guys
by Dan () on 20 May 2004 11:28pm GMT

hi guys im jsu getting started on this php it's all confusing and stuff lol if ya wana check out me site go ahead i need some ideas and hlp :)

time for an update?
by Darren Johnston ( on 22 May 2004 3:11pm GMT

this is a bit of work. though it is always better to start with debuged code, so one has a working bugfree login script to build from as we are not all security experts. especially for those of us new with php. it is unfortunate the changes have not been made to the source which are discussed in this forum. But if you put a lot of work into it, download the dependancies, it will work.

by Martin ( on 25 May 2004 8:48am GMT

This tutorial is totally outdated when using the latest PEAR. Specially the HTML/Form.php.

by DEWMAN ( on 27 May 2004 6:25pm GMT

I changed everything I thought I was suppose to and I am now stuck. I get "DB Error: not found" I know the database is there and works. I used the included .sql file to load it so all the tables should be there also. I'm not sure where to go from here.

Stuck x2
by TordeK ( on 2 Jun 2004 5:37am GMT

i got the same problem as the post above, if you find a solution, could you please email me your findings?

im sure once i get the script working it will be great :) thx for ure hard work ;)

Great script
by PHP_learner () on 9 Jun 2004 11:09am GMT

Looks like a great script, but I got the same problem. I get the error "DB Error: not found" Its probably in the line '$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";'in config.php Could some 1 please modify this so it can work in a local server?

by justin scott ( on 9 Jun 2004 7:33pm GMT

i keep getting this on every php page

Warning: main(html_form.php): failed to open stream: No such file or directory in /home/jscott/public_html/login.php on line 8

Fatal error: main(): Failed opening required 'html_form.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jscott/public_html/login.php on line 8

can you help??

Teach To DEbug
by eli () on 11 Jun 2004 10:54am GMT

I guest this script will teach us how to debug. heheheh

doesn't work
by shaun () on 11 Jun 2004 10:40pm GMT

I still can't get it to work...can you help me. im with

im lost
by BUG ( on 15 Jun 2004 4:34pm GMT

"Fatal error: Call to undefined function: begin_html() in /data/www/expert-gamers/ga-league/index.php on line 4"

Can you tell me exactly what to do plz (in a e-mail)

same as justin scott
by Jaiji ( on 18 Jun 2004 2:38am GMT

Warning: main(html_form.php): failed to open stream: No such file or directory in /edp/web-based/public_edp/xxxjaijixxx/xXxRamonxXx/xxxReyviexxx/php-login-script/login.php on line 8

Warning: main(../config.php): failed to open stream: No such file or directory in /edp/web-based/public_edp/xxxjaijixxx/xXxRamonxXx/xxxReyviexxx/php-login-script/global.php on line 6

Fatal error: main(): Failed opening required '../config.php' (include_path='.:/usr/lib/php/:/usr/share/pear/') in /edp/web-based/public_edp/xxxjaijixxx/xXxRamonxXx/xxxReyviexxx/php-login-script/global.php on line 6

Fatal error: main(): Failed opening required 'html_form.php' (include_path='.:/usr/lib/php/:/usr/share/pear/') in /edp/web-based/public_edp/xxxjaijixxx/xXxRamonxXx/xxxReyviexxx/php-login-script/login.php on line 8

by :-) (anon@anon.anon) on 18 Jun 2004 11:07am GMT



In one of the emails above posted by Chris ( on 7 Mar 2004 12:15pm there is a URL to a modified plug-and-play working version of Martin's login script.

Has anyone tried it? Does it work? Is it okay, security wise?


by Dale ( on 20 Jun 2004 12:00pm GMT

I've tested this script and it does work however it does need a lot of work to be usefull but it is functional as it currently is.

The e-mailing to authenticate has been disabled.

by BaZ () on 21 Jun 2004 9:15pm GMT

I am not able to get a config.php open

Warning: main(): Unable to access ../config.php in /home/virtual/site30/fst/var/www/html/global.php on line 6

Pear DB
by YuanYuan () on 6 Jul 2004 10:06am GMT

on the Windows, if U need use Pear,

jut go c:\php, run go-pear.bat ,

and when it finish.

UR pear will run.

Login Script in PHP
by Jay ( on 19 Jul 2004 8:56am GMT

In your Login Script in PHP there is no config.php. Can you Please help me?

this is old
by saab () on 27 Jul 2004 5:13pm GMT

come on guys. this script is freaking old. i mean really old. look at the date. it has been about 2 years.

all the stuff is messed up here. missing files. unknown functions and missing parameters to functions.

by asad ( on 1 Aug 2004 5:23am GMT

i want to download my yahoo messenger.plz help me.

u r all fools
by nude ( on 11 Aug 2004 11:56am GMT

i am the programmer of this script.u are all fools kiss my ass, i am least bothered about the problems u guys r facing.KISS MY BIG ASS!

hahaha, JOKERS!

by jp ( on 24 Aug 2004 4:05am GMT

such a bullshit and old script u don't have to put it here if it is not working and some files are missing. Be a responsible person.
by carlo () on 24 Aug 2004 4:27am GMT

yeah your right jp such script like this must not be put here such a fool move.

by ( on 31 Aug 2004 9:23am GMT


This message is in regards to the references to the file: config.php in the script provided on this(ese) pages. The "Installation guide" indicates that one needs to download this file from the "download page". However, this file does not exist. :( I have a solution for those who care. :) Simply create an empty file in your chosen plain text editor. In this empty file place the following:



Now save this file as: config.php. You're done. Now you have the file that the script calls and you will not recieve an error.


by NoNeed4Name ( on 5 Sep 2004 12:18am GMT

i downloaded this script work on it about half an hour,got many errors,fixed some,couldn't find where the hell is this DB.php file etc. etc. etc... and gave up at the end.

But any way,i would like to thanx to Martin that at least he tried to do something good and FREE!!!! NOT like some of us who tries to sell real bullshits with green dollars.I'm seeing people around internet who asks for 40 green USA dolars for couple line scripts.

After all what i wanna say, before you swear at someone,please first think for a second! If you CANNOT make something better then how can you swear someone who makes what you COULD NOT!!!

Thanx for the script again Martin.


this script is freaking old
by making () on 5 Sep 2004 7:58pm GMT

come on guys. this script is freaking old. i mean really old. look at the date. it has been about 2 years.

all the stuff is messed up here. missing files. unknown functions and missing parameters to functions.

by shaiful ( on 10 Sep 2004 2:58am GMT

i have dl the script, do it have to be installed?how?

DB_Common ---> HELP!!!
by Lakina ( on 13 Sep 2004 5:23am GMT

Does anyone know where DB_Common package is? We looked over the Pear package search but its not there.

Signup does nothing...
by Bob Radvanovsky ( on 24 Sep 2004 8:58pm GMT

I've followed the instructions, along with the modifications necessary. I've got the "signup.php" working, but upon hitting "Submit"....nothing.

I checked the database, and there are no entries within the database.

Any ideas?



by () on 6 Oct 2004 3:55pm GMT

I read all the comments above this one and did everything what i've needed. But I miss the DB.php file. Has anyone this file or can anyone give me a link to this file?

by WebAdept ( on 14 Oct 2004 8:48pm GMT

I read all these comments too,.. I feel like it is sort of a car wreck with dead bodies laying around.. I'm horrified, but I can't look away.

Dudes, he wrote a cool example using PEAR and DB.php, and some rather nice object code in there as well.. have to admit that I picked up more than a few ideas just browsing through his code.

What he didn't do, however, is subjegate himself to eternal servatude to those that can't read the basics themselves. I mean, come on .. really.. you make is sound like he's hurt you or was dishonest some how. Get a grip. If you spent just a fraction of the time, looking some of this stuff up yourself as you do writing these pleading posts, you would have solved it, and learned a new skill many days ago. Seriously, look how long it takes to type all those "please" me's .. againt how log it takes to type in PEAR or DB.php in the Google... I tell ya, it is sad to see the hours wasted...

Anyway.. back to my host, who is probably scratching his head thinking 'who the heck is this guy and how do I get him to shut up?' .. Thanks for the examples, and I really did enjoy them. I hope that you don't take these comments personally, or decide that it is your code that needs fixing, and not some peoples mental habitual out looks on life. Very clean stuff there. well done indeed.

nice coding dude
by slaske ( on 18 Oct 2004 6:56pm GMT

i just wanted to ask some ?'s but they've all be aked before, hehe.

thats why i choose to find out for myself... check if you're a newb.

slaske 19.10.2004

by Basti () on 5 Nov 2004 1:00pm GMT

I found a DB.php file but its not compatible with this login script. So I need a DB.php file which is written for this loginh-script.

by mukul kumar ( on 9 Nov 2004 8:22am GMT

i need PEAr.php . where will i get this file.

by Suzanne ( on 10 Nov 2004 3:12pm GMT

hello can someone show me how to make a contact form to the members area so the user he will contact me with his username and he can't contact me without login

thx for this script
by widhi ( on 12 Nov 2004 12:16pm GMT

i try searching script that can make different login page for different user.. hope it can be what i'm thinking..thx

How to download?
by pissa () on 18 Nov 2004 3:30pm GMT

I usualy dont download anything from internet but now i wonder how to download the login script? when i do it, a lot of files is shown and i dont now what to do with them? HELP MEE!!

config.php file
by Trev () on 20 Nov 2004 4:53am GMT

Hi great site, just working through the script, can you tell me where the file config.php is , i have searched the entire site and can not find it

by Trev ( on 20 Nov 2004 8:53am GMT

can you let me know what you would charge to set this script up, i have spent a few hours on it now, got some bits to work, i also have some other coding work if you are interested



login script idea
by Mike () on 25 Nov 2004 11:39pm GMT

hey, i was wondering, if it was possible to MD5 hash the whole username that the user enters and store in the database only MD5 hashed usernames, because this would probably really be good for preventing SQL injection attacks, wouldnt it?

just a thought, dunno if this has been done before, thats all. i cant think of any drawbacks such a thing would have.

you could just use php to ensure the usernames arent of an improper format, like if they contain unicode symbols, html tags, spaces, etc, and then once php is sure this is an acceptable username, php would MD5 hash it and store that in the database.

any thoughts on this?

Where is DB.php file
by Angel () on 30 Nov 2004 7:48pm GMT

I need the DB.php file, I can't find this file please help me! I need it.

required 'html_form.php'
by senthil ( on 16 Dec 2004 9:59am GMT

Fatal error: Failed opening required 'html_form.php' (include_path='.:/usr/share/pear') in /var/www/html/source.php on line 8

comes when i try to open login.php. But am i opening it right or do i need to make another page with the login? And where is it in what file you make the page that logged ind users are redirected to?

Be willing to learn
by Cedrus () on 17 Dec 2004 2:10pm GMT

Honestly, how some of you guys can look at themselves in the mirror remains a mystery to me.

It's thanks to guys like Martin that I got a better insight in PHP.

There are no good scripts that you just download and implement.

The only good script comes from your own mind, nothing beats those.

Martin ,together with many others, has given me fresh idea's, new perspective on certain things, and for that I'm grateful.

If you're not willing to learn and do some investigative work of your own, you've got no business whatsoever with the work of others,

work that they offer you in the hope that you will pick up something.

Thanks a lot for your efforts Martin.

db error :not found
by Akash Takyar ( on 22 Dec 2004 6:18pm GMT

Thanks for that helpfull script.

I am having the same problem of DB error:not found . Please send me the complete solution to this i really need that fast.I am expecting a favourable response fast.

learn PHP
by joinPHP () on 29 Dec 2004 9:32am GMT

Come on people, stop making stupid questions and learn PHP...

If you don't understand the basic of the language, consider doing something usefull instead making this kind of questions and repairs..

The script sucks??? Do you want all the stuff complete???work on it!!!

get a life
by maceo ( on 29 Dec 2004 2:35pm GMT

Quote: "Come on people, stop making stupid questions and learn PHP..."

Gee......I thought that asking questions was part of learning. Not everyone was born brilliant like 'joinPHP' obviously was.

Oh great master, please impart some of your vast knowledge on the rest of us mere mortals.

Get a life and either be willing to help or just stay out of the way.

by KraKarjaK ( on 3 Jan 2005 8:39pm GMT

I'm not even gonna rag on you, all I got to say is the script doesn't even work on your own website you fucking moronic backward ass half baked bastard. I have been messing with this script on and off for a couple of years now. It was only today that I decided to really make it work and found this little website. This file is floating around every where, the forums, the file share utils, other sites. Take this shit off the web.

by KraKarjaK ( on 3 Jan 2005 8:40pm GMT

I guess I decided to rag on you after all. Fuck you.

vauthenticate takes five minutes to set up
by () on 3 Jan 2005 9:01pm GMT

confused - willing to pay
by Adam ( on 5 Jan 2005 9:32pm GMT

I own a site with php nuke - but i want a different registration so that their username is their email address, they have their own account page which I want to make alot different than the one php nuke creates for a user... i need a login page... i want them to have to check their email for a password... and i want them to receive a referral id if they refer other people to the site which they can put on the end of a link to the site. e.g.

I'm too confused to do this myself, but if someone can actually help me do this i am willing to pay 150 USD for this... email me at if you think you can help me :S

Shut the Hell up.
by ._.; ( on 7 Jan 2005 8:41pm GMT

Please, before attempting to use this script Learn up about PHP and if you don't already know HTML then you are a sad, sad person. I'm sure your causing piles of 500 errors and other such.

I'm sure Poor Martin is just suffered enough and is trying to get all the glitches out of the code.

Then Again, He could have given up long ago, because y'all are such asses.


There's gonna be something on and off everywhere. We're only human.

NOW GO AWAY AND LEARN PHP AND MAKE THE CODE YOURSELF. Maybe you'll make something out of your life.

Also, note the Copyright down at the bottom of the Page. That was 3 years ago, guys! It also looks like that was his last post then, too. GO AWAY. LEAVE THIS POOR BOARD ALONE AND QUIT RAPING THE HELL OUT OF THE SERVER.

by () on 12 Jan 2005 6:44pm GMT

I think you guys maybe should have done a few things to this before you published it.

I give up
by prana ( on 13 Jan 2005 4:06pm GMT

Seems there many changed, this is not even close to run. For me it should be better to have easy working script. I can customize it later. But if I need to hours to make it working then I prefer to write own on >_<

by Anne () on 22 Jan 2005 2:46pm GMT

I've noticed that people write scripts, other people ask questions and what do they get ? A "nerds" answer ... F.e. answer on the first post : "define something yourself" ... and what the hell is 'something' ... yeah right ... find out yourself :-)

regarding configuring mysql in windows
by satish ( on 24 Jan 2005 8:00am GMT

when i run the php page which contains the database related stuff, i get an error call to undefined function mysql_connect(). can any one help me regarding this

usefull script
by Nadeem Ahmed ( on 27 Jan 2005 9:39am GMT

really thses are helpfull script for me

very difficult
by alfin ( on 1 Feb 2005 7:38am GMT

this script not detail, so we very difficult for understanding it (in begin html).