Jump to content

Recommended Posts

i have used a tutorial to create a blog - 'http://www.devshed.com/c/a/MySQL/Creating-a-Login-Script-for-a-PHPMySQL-Blogging-System/' and ive got it all working but im having a major problem when i login.  when i register on this page - 'http://www.asdesigns.co.uk/LoginScript/register.php' it all registers fine and i can see it all going into my database.  the problem is when i login on - 'http://www.asdesigns.co.uk/LoginScript/login.php' i got the username is wrong error.

 

ive added the files in zip file that are to do with the login but i cant seem to work out why i get this error.

 

could someone please advise where this error is.

 

Thanks in advance

 

[attachment deleted by admin]

That script is using password('$pw1') in the registration script but is not doing the same thing when it checks in the login page, so that script never worked and no one cared enough to correct it after it was posted.

 

Also, the script should NOT be using mysql's password() function in the first place. It should be using either md5() or sha() AND it should be doing the same thing in both the register and login script.

I've found out what it actually does. and wouldnt have a clue how to fix it.  when you register and put your password in for example 'test' it converts it to md25 and then when you try and login you cant type in 'test' you have to type in the md25 of 'test' so the password would be '49f68a5c8493ec2c0bf489821c21fc3b' when obviously thats not right

I've found out what it actually does. and wouldnt have a clue how to fix it.  when you register and put your password in for example 'test' it converts it to md25 and then when you try and login you cant type in 'test' you have to type in the md25 of 'test' so the password would be '49f68a5c8493ec2c0bf489821c21fc3b' when obviously thats not right

Read PFMaBiSmAd's (Thank god for Copy and Paste) post above. To validate the user's login, you simply md5 the password that they typed in the login form and check if the output is the same as the one in the database.

So, after you changed the register code so that it stored the md5 of the entered password, did you delete any rows from your table and re-register so that the value stored in the table would be updated so that the query in the login code could match the md5 value?

yer ive finally got it to login but now im having some other troubles.

ive got most of it all set up but when i log in as an admin the create a new thread doesnt appear.

 

this is the link i am trying to get at:

 

<? if($_SESSION['level'] == "Admin") {?>
        <tr>
          <td width="17%"> </td>
          <td width="83%"><a href="new_post.php">Create New Thread </a></td>
        </tr>
	<? }?>

 

my database table has a field called level and in that field is called Admin but yet i cant seem to see that link.

 

feel free to try out the website:

http://www.asdesigns.co.uk/LoginScript/register.php

 

but when you log in and then create a new user and make it an admin from the dropdown menu and then login as that 'admin' it doesnt display the create new thread link.

 

Thanks

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.