Jump to content


Photo

registration script help needed


  • Please log in to reply
2 replies to this topic

#1 Warrior19

Warrior19
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 May 2006 - 04:31 AM

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.

i already tryed this:

$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.

#2 EKINdesigns

EKINdesigns
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts
  • LocationUSA

Posted 31 May 2006 - 05:11 AM

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:

$password = mysql_escape_string(htmlentities($_POST['pw']));
$finalpw = md5($password);
Enjoy!

#3 Warrior19

Warrior19
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 May 2006 - 05:16 AM

[!--quoteo(post=378596:date=May 31 2006, 12:11 AM:name=EKINdesigns)--][div class=\'quotetop\']QUOTE(EKINdesigns @ May 31 2006, 12:11 AM) View Post[/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:

$password = mysql_escape_string(htmlentities($_POST['pw']));
$finalpw = md5($password);
Enjoy!
[/quote]
im not using mysql im using mssql would it still work?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users