SReject why didnt you post this as script ._.?
since it wasnt a comment to improve the code or alternative methods... its far away from the original code
by the way, someone may say that, using $encode its easy enough to break the pass
i think that $md5 comparation its safer, i didnt think in that when i did the code long time ago