dadamssg Posted March 26, 2009 Share Posted March 26, 2009 im trying to come up with some of hash value based upon two values...im not real sure if hash() takes two and jumbles them up and spits out some hash. thats what i want. so anyways ive made these variables which work $username = clean_data($_POST['username']); $password = clean_data($_POST['password']); i want to use them like this $confirmhash = hash('$username', '$password'); so then i can put that hash in my db...will this work or am i doing something completely wrong? Link to comment https://forums.phpfreaks.com/topic/151186-correct-use-of-hash/ Share on other sites More sharing options...
9three Posted March 26, 2009 Share Posted March 26, 2009 If you are accepting input from users, you need to use mysql_real_escape string to stop SQL injections. You can use md5 to encrypt the information. $username = mysql_real_escape_string(($_POST['username'])); $password = mysql_real_escape_string(($_POST['password'])); Link to comment https://forums.phpfreaks.com/topic/151186-correct-use-of-hash/#findComment-794210 Share on other sites More sharing options...
dadamssg Posted March 26, 2009 Author Share Posted March 26, 2009 right, thats what the clean_data() function i created is...im wondering about the hash though Link to comment https://forums.phpfreaks.com/topic/151186-correct-use-of-hash/#findComment-794211 Share on other sites More sharing options...
Mchl Posted March 26, 2009 Share Posted March 26, 2009 Why don't you check out hash in manual? It's all there. And no... you don't need to escape string, that's going to be hashed anyway... (Unless you want to hash it using MySQL's hashing functions) Link to comment https://forums.phpfreaks.com/topic/151186-correct-use-of-hash/#findComment-794267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.