Taipan Posted March 12, 2006 Share Posted March 12, 2006 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 More sharing options...
Taipan Posted March 12, 2006 Author Share Posted March 12, 2006 I figured it, the database field only had 16 characters allocated for it, it needed around 40. Now it works. :D Link to comment https://forums.phpfreaks.com/topic/4732-problem-with-password-encoding/#findComment-16576 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.