Page 1 of 1

help with a secure login system

Posted: Wed Dec 31, 2008 4:33 pm
by chris_s_22
ok someone kindly sold me a login script to start me off which he showed me how to conect to my database again which he kindly showed me how to make along with the table. but has now left me to it

the script seems to be working.

all the php documents he sent me was
index
functions - seems to give added protection password is included in init page.
init - this seems to apear on all pages which seems to be the conection.
login - im getting mixed up with this and the next page
login form
register - again i get mixed up with this and the next page
register form

ok now the bit i get lost. lets say i got a 4 page site lets say a
page 1 - index welcome page
page 2 - home page with a login link
page 3 - login page
page 4 - the actually protected area that only members can see

my 1st question is:
On page 2 the login link i make there, do i link to a file he sent to me? (which one?)
or
do i have to create another page?

My second question is:
Have i already got page 4 in what ive been given? or do i have to create this?

Last question
what info need to be on every page so only members can view?

Re: help with a secure login system

Posted: Thu Jan 01, 2009 5:24 pm
by it2051229
ok so you bought it huh? You know there're A LOT of free tutorials on how to create a login script in PHP provided that you know how to program. You can just google it.

Re: help with a secure login system

Posted: Thu Jan 01, 2009 5:29 pm
by Syntac
Who in their right mind would buy something as spectacularly simple as this? :?

Re: help with a secure login system

Posted: Thu Jan 01, 2009 5:35 pm
by it2051229
Who in their right mind would buy something as spectacularly simple as this?
What kind of a question is that? isnt it obvious? :D

Re: help with a secure login system

Posted: Thu Jan 01, 2009 5:54 pm
by watson516
chris_s_22 wrote:ok someone kindly sold me a login script to start me off which he showed me how to conect to my database again which he kindly showed me how to make along with the table. but has now left me to it

the script seems to be working.

all the php documents he sent me was
index
functions - seems to give added protection password is included in init page.
init - this seems to apear on all pages which seems to be the conection.
login - im getting mixed up with this and the next page
login form
register - again i get mixed up with this and the next page
register form

ok now the bit i get lost. lets say i got a 4 page site lets say a
page 1 - index welcome page
page 2 - home page with a login link
page 3 - login page
page 4 - the actually protected area that only members can see

my 1st question is:
On page 2 the login link i make there, do i link to a file he sent to me? (which one?)
or
do i have to create another page?

My second question is:
Have i already got page 4 in what ive been given? or do i have to create this?

Last question
what info need to be on every page so only members can view?
Well, since the other people decided to tell you you're an idiot for buying a login script instead of helping you, I will go ahead and do it.

login is probably the page that handles the login form and login form is the actual login form.

register and register form are probably the same as above.

Q1:
For login, you should probably call the login.php file. The action of the 'quick login' form as well as the login page form should both be that file.

Q2:
The 'members area' is not really anything special other than the check at the top of the page to see whether the user is logged in or not. If they aren't logged in, redirect them to the login page.

Q3:
The 'members area' pages should include a check before anything else. Depending how the login script works, it could be a number of different ways I would think. I am going to assume you are using sessions...

Code: Select all

<?php
session_start();
if(!$_SESSION['level']) header('Location: login.php');
...
?>
That should check to see if the $_SESSION['level'] is 0 or not assigned and redirects the user to login. If the user is logged in and the $_SESSION['level'] has been set to something higher than 0, the user won't get redirected.

Re: help with a secure login system

Posted: Fri Jan 02, 2009 8:59 am
by chris_s_22
thanks watson516