Jump to content

Recommended Posts

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: user1

Password userpw

userpw = 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

[!--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?
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.