Jump to content

php login video tutorial problem


jamie

Recommended Posts

I am having trouble logging in to the members.php with my code. I thought the password was set up in the config with this line

 

$config['salt'] = 'jk7d?3';

 

so when I try to login, I keep getting the error. Of course the password field in the database just shows a bunch of characters

Link to comment
Share on other sites

The password is whatever you set initially when you first set up the database. I believe the first video covers "temp.php" which should look something like this:

 

<?php

echo md5('admin' . 'jK7d?3');

?>

 

The actual password is the beginning portion of the string within md5() - "admin". The salt at the end, "jK7d?3" is just a way to add extra variety/security to the password when it is encrypted using md5(). This makes it more difficult for someone to discover the password in case someone who isn't authorized gets access to the database.

Link to comment
Share on other sites

I copied it exactly so I also have jk7d?3 but when I put that into the password box, I still get the error.

You put "admin" into the password box?

 

According to the way I set things up by default, the username is "admin" and the password is "admin" (obviously you would want to change this to something more secure on a live site.)

Link to comment
Share on other sites

You put "admin" into the password box?

 

According to the way I set things up by default, the username is "admin" and the password is "admin" (obviously you would want to change this to something more secure on a live site.)

 

I cannot get logged in to the system. I deleted the admin because it wasn't working and I inserted a new user using phpmyadmin and I still get the error when trying to login. How can I make a new user so that I can view the members.php page

Link to comment
Share on other sites

Thanks, got it. One other thing - can you post the username/password of the user you created in the database (within the members table)? PM or email it to me if you'd prefer, though if you are developing on your local computer, there shouldn't be any security issues with sharing that info.

 

I'm not immediately seeing any code issues, so I want to plug it into my setup and test it. Thanks.

Link to comment
Share on other sites

I tried testing your code with my own database, and it is working fine for me.

 

Assuming your your password is "admin" and the salt is "jK7d?3", the password that is stored in the database should be "544eec763df08ecb6024f60f39fdc627". Make sure it contains exactly that, and you aren't missing letters at the beginning or end, in case you copied it incorrectly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...