Warrior19 Posted May 31, 2006 Share Posted May 31, 2006 Hello, im new to this forums, im sorry if this is wrong section. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] I want to make a script in php that what the user writes for the password gets converted to md5 value and inserted into database table = varbinary.Example:Username: user1Password userpwuserpw = gets converted to md5 (varbinary)and get inserted into the mssql database.[b]i already tryed this: [/b]$password = stripslashes($_POST['pw']);$enc = md5($password);$finalpw = "enc";and didnt worked, maybe was me that did it wrong, and code is wrong. im still a noobie :)thank you, i hope you understand what im trying to do. Link to comment https://forums.phpfreaks.com/topic/10821-registration-script-help-needed/ Share on other sites More sharing options...
EKINdesigns Posted May 31, 2006 Share Posted May 31, 2006 i am not sure why you would do a strip slashes. There shouldnt be any quotes in the password.This is how i would do it:[code]$password = mysql_escape_string(htmlentities($_POST['pw']));$finalpw = md5($password);[/code]Enjoy! Link to comment https://forums.phpfreaks.com/topic/10821-registration-script-help-needed/#findComment-40452 Share on other sites More sharing options...
Warrior19 Posted May 31, 2006 Author Share Posted May 31, 2006 [!--quoteo(post=378596:date=May 31 2006, 12:11 AM:name=EKINdesigns)--][div class=\'quotetop\']QUOTE(EKINdesigns @ May 31 2006, 12:11 AM) [snapback]378596[/snapback][/div][div class=\'quotemain\'][!--quotec--]i am not sure why you would do a strip slashes. There shouldnt be any quotes in the password.This is how i would do it:[code]$password = mysql_escape_string(htmlentities($_POST['pw']));$finalpw = md5($password);[/code]Enjoy![/quote]im not using mysql im using mssql would it still work? Link to comment https://forums.phpfreaks.com/topic/10821-registration-script-help-needed/#findComment-40453 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.