Jump to content

Recommended Posts

Hi,

I moved my website to a new server and now the password encoding doesn't work anymore. I am not sure if the new server has a different version of php. Can't think why this would not work anymore.

This is the code that enters the info into the database when someone registers:-[code]$query = "INSERT INTO customers ( first_name, last_name, email, street_name, city_name, state_name, post_code, country_name, phone_number, password, registration_date) VALUES ( '$fn', '$ln', '$e', '$sn', '$cn', '$st', '$pc', '$c', '$ph', PASSWORD('$p'), NOW() )";
[/code]
and when you try to log in this code is checking the email address and password, if there is a match it logs them in:-
[code]$query = "SELECT customer_id, first_name FROM customers WHERE email = '$e' AND password = PASSWORD('$p')";
[/code]

If I take out the PASSWORD() part and just enter in the password as '$p' then it works fine. If anyone has any ideas why this no longer works, I'd really appreciate the help.

Chris
Link to comment
https://forums.phpfreaks.com/topic/4732-problem-with-password-encoding/
Share on other sites

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.