this is how I would do it:
your login form and signin script go into the same file, call it controlaccess or accesscontrol or something like that...
when you want a page being protected you include that file at the top of the file to protect..
when the file is opened then it opens accesscontrol which is is something like this:
// accesscontrol
if(isset($uid)) {
check user id and password in the database
if ok, do nothing (i.e. the page opens)
else {
exit; // end page here so page isnt opened..
}
}
if(!isset($uid)) {
show login page,
with $PHP_SELF as action....
}
that should work 🙂
if you are encrypting passwords however, it will reencrypt the encrypted every time it checks the details ... therefore you need a little variable in the login form, e.g. $firsttimelogin...
then have
if(isset($firsttimelogin)) {
$pwd = encrypted $pwd etc etc ;
unset($firsttimelogin) ;
}
thats the basics.. you may be able to get it to work from that.....
good luck