help needed with crypt()

From: Date: Tue, 03 Dec 2002 14:45:15 +0000
Subject: help needed with crypt()
Groups: php.general 
Request: Send a blank email to php-general+get-126858@lists.php.net to get a copy of this message
Hi The script is not working. function authenticate($user,$pass) { $result = -1; $data = file("shadow"); /* permission every one read */ foreach($date as $line ) { $arr = explode(":",$line); if($arr[0] == $user) { /* user name matching */ if(crypt(trim($pass),$salt) == $arr[1]) { $result = 1; break; } else { $result = 0; break; } } /* end of for */ return $result ; } The above programme always returs -1. Any help would be appreciated. regards CVR __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

« previous php.general (#126858) next »