brooksh Posted February 11, 2013 Share Posted February 11, 2013 If I set my password in the script it works, but if I submit the password in a form it doesn't. When echoing the password, both show the same thing. The login_pass2 encrypts correctly, but the login_pass does not. I've also tried doing $login_pass = "$_POST[login_password]"; but it doesn't work. Can anyone figure out why this isn't working? $login_pass = $_POST['login_password']; //posted = pass1234 $login_pass2 = "pass1234"; echo "$login_pass and $login_pass2";// shows pass1234 and pass1234 $encrypted_pass = data_encrypt($login_pass,$key); $encrypted_pass2 = data_encrypt($login_pass2,$key); echo "$encrypted_pass and $encrypted_pass2"; // shows 9lf8xG573pp+8DkhzK/Bu7GPFQQzg40mZZEGIF9Qg7c= and Ex20uB9BVZgqOqjjEu5hDXN+JQu0b4qPn15CXsKOlls= Quote Link to comment https://forums.phpfreaks.com/topic/274329-password-encryption-not-work-after-post/ Share on other sites More sharing options...
cpd Posted February 11, 2013 Share Posted February 11, 2013 Have you confirmed POST data was sent with the request? To do this just dump the $_POST array e.g. var_dump($_POST); Quote Link to comment https://forums.phpfreaks.com/topic/274329-password-encryption-not-work-after-post/#findComment-1411691 Share on other sites More sharing options...
brooksh Posted February 11, 2013 Author Share Posted February 11, 2013 Thanks, that solved it. For some reason my posted password had a space in it. Quote Link to comment https://forums.phpfreaks.com/topic/274329-password-encryption-not-work-after-post/#findComment-1411728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.