The script is excellent, but I don't understand one thing. After you login as a successful user, the "accesscontrol.php" script appears to be blank. There should be some message which appears for a successful user. Moreover the "accesscontrol.php" script is also an include file. So this message should only appear on the page, which the user sees after logging in for h first time. Has anyone figured this out as yet?
I know its a little late, but I had the same result as Gaurav. I don't think the author ever intended that page to be used on its own. If you were to log into the protectedpage.php page, you will notice that you are logged in and greeted with a welcome message. Therefore, I believe the author intended it to be used as a processing script only. I did however find the lack of a logout feature dissapointing.
The size of this field needs to be much larger, the encoded passwords created on my site (PHP version 4.4.8 & MySQL version 4.1.22)were over 40 characters long and it took me a while to figure out why I could never log in.
Increasing the size to 100 fixed the problem and it now works perfectly.
You are getting the site database is unavailable because you have forgotten to change the name of the database set in this example to your own database name, make sure you change whatever he has in bold.
I have a problem too, i dont know if someone could help me out, im a newbie in Mysql but this example is quite useful, I made it run perfectly, I can actually register and my database shows everything perfect, userid, name, email, and encrypted password. Once i receive an email with an automatic password i try to login using the userid and the password sent to me by email... I cannot login, i get "Your user ID or password is incorrect, or you are not a registered user on this site"... I am being REALLY CAREFUL by the way, I have registered a bunch of users and have gotten different password and i am just not able to login, what could be the problem?
rafs: refer to Howitzer's comment about the column not being initially big enough to save an encrypted password in the mysql database. Increase the column size to at least 100 or remove the PASSWORD encoding functionality from the line of code below:
The Signup page worked wonderfully I received my new password by email but when I try to login the system notifies me that I entered the wrong username/password. I verified my db and my password is hashed so its fine.
Any thoughts??
Where in the code does it tell to redirect the user to protectedpage.php? It it automatically because it detects the <?include protectedpage.php?> in the web page.
Thanks;
Ricky
with reference to creating the script, shortly after creating the common.php and db.php, where would I put the
if (!isset($_POST['submitok'])):
// Display the user signup form
...
it is causing me confusion and don't really understand why it would go in front of the html tag of the "New User Registration" form, when I was in the understanding that this should be the signup script.
thanks,
C
Bookmarks