jkewlo Posted September 8, 2009 Share Posted September 8, 2009 Hello, I am back yet again >< So I have run into this error Fatal error: Cannot redeclare hash() in /var/www/www.eve-lounge.com/htdocs/v2/data/function.class.php on line 23 my question is why? this is my code line 23 is in the function hash() and is the closing } bracket. I dont understand why I am getting this error and how will I got about fixing it. Thank you very much. //clean input function sanatize($data){ $data = stripslashes($data); $data = htmlentities($data); $data = mysql_escape_string($data); return $data; } //hash + salt function function hash($data){ $salt = "R3\£41d*7\"2$,."; $data = $data . $salt; $data = sha1($data); return $data; } //update lastclick in database function lastClick(){ $username = $_SESSION['username']; $sql = mysql_query("UPDATE `users` SET lastclick = 'NOW()' WHERE username = '$username'"); } Link to comment https://forums.phpfreaks.com/topic/173472-solved-fatal-error-cannot-redeclare-hash/ Share on other sites More sharing options...
Philip Posted September 8, 2009 Share Posted September 8, 2009 Your PHP's core comes with hash functions, which includes hash(): http://php.net/manual/en/function.hash.php You need to rename your function Link to comment https://forums.phpfreaks.com/topic/173472-solved-fatal-error-cannot-redeclare-hash/#findComment-914414 Share on other sites More sharing options...
jkewlo Posted September 8, 2009 Author Share Posted September 8, 2009 I <3 you, thank you very much Link to comment https://forums.phpfreaks.com/topic/173472-solved-fatal-error-cannot-redeclare-hash/#findComment-914418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.