Guest Posted March 12, 2007 Posted March 12, 2007 Hi Guy's, I have searched as many pages in this forum as I could before posting this so please be gentle :D I want to be able to import a whole bunch of users into my osc store and I want to know what MD5 hash i should use in php? I tried using md5($password) but the hash is coming out wrong/??? do I need to add some salt ? ? Any help would be greately appreciated. Thanks. Rabbie.
Guest Posted March 12, 2007 Posted March 12, 2007 I have tried using: $password = '$_POST['password']'; $salt = substr(md5($password), 0, 2); $password = md5($salt . $plain) . ':' . $salt; echo $password; But the hash is still wrong.. Can someone please help ?
Guest Posted March 12, 2007 Posted March 12, 2007 OK, I've now tried to do this: // This generates the random number and establishes the tep_rand function. function tep_rand($min = null, $max = null) { static $seeded; if (!isset($seeded)) { mt_srand((double)microtime()*1000000); $seeded = true; } if (isset($min) && isset($max)) { if ($min >= $max) { return $min; } else { return mt_rand($min, $max); } } else { return mt_rand(); } } // This part converts the plain text password to the hash. $password = 'test1'; for ($i=0; $i<10; $i++) { $password .= tep_rand(); } $salt = substr(md5($password), 0, 2); $password = md5($salt . $plain) . ':' . $salt; echo $password; I put the hash which now looks like: 45f9901d0370bc0facb9220619e6cbd7:d6 into the mysql database but I still cant log into the shop with that user.. Any help would be greately appreciated. Thanks.
Guest Posted March 12, 2007 Posted March 12, 2007 Come on guy's, I cant believe no-one knows how to create a new user directly though the mysql database ?? Can someone atleast point me in the right direction or tell me what I'm doing wrong ? Thanks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.