Your last loop, which seems pointless anyway since it's just overwriting $hashedcode
, will never end because you're incrementing a constant i
instead of the $i
var, and so $i
remains 0, which is forever less than 5, yielding that condition infinitely true:
for($i=0;$i<5;i++){
$hashedcode = sha1($hashedcode.$code.$salt);
}
should be
for($i=0;$i<5;$i++){
$hashedcode = sha1($hashedcode.$code.$salt);
}