"Cambodgienne", "Cambodgien"=>"Cambodgien", "Belge"=>"Belge", "Canadienne"=>"Canadienne", "Canadien"=>"Canadien", "Chinoise"=>"Chinoise", "Chinois"=>"Chinois", "Française"=>"Française", "Français"=>"Français", "Laotienne"=>"Laotienne", "Laotien"=>"Laotien", "Suisse"=>"Suisse", "Vietnamienne"=>"Vietnamienne", "Vietnamien"=>"Vietnamien", "Malagasy"=>"Malagasy", "Autre"=>"Autre"); $Activite = array( "??"=>"??", "AUF"=>"AUF", "Etudiant"=>"Etudiant", "Enseignant"=>"Enseignant", "Autre"=>"Autre"); $Domaine = array( "??"=>"??", "Agronomie"=>"Agronomie", "Anglais"=>"Anglais", "Archéologie"=>"Archéologie", "Architecture"=>"Architecture", "Biologie"=>"Biologie", "Chimie"=>"Chimie", "Commerce"=>"Commerce", "Droit"=>"Droit", "Français"=>"Français", "Génie Civil"=>"Génie Civil", "Génie Electrique"=>"Génie Electrique", "Génie Industriel"=>"Génie Industriel", "Géographie"=>"Géographie", "Géologie"=>"Géologie", "Gestion"=>"Gestion", "Histoire"=>"Histoire", "Hydraulique"=>"Hydraulique", "Informatique"=>"Informatique", "Ingénieur"=>"Ingénieur", "Littérature"=>"Littérature", "Linguistique"=>"Linguistique", "Mathématique"=>"Mathématique", "Médecine"=>"Médecine", "Odontostomatologie"=>"Odontostomatologie", "Pharmacie"=>"Pharmacie", "Philosophie"=>"Philosophie", "Technicien"=>"Technicien", "Touriste"=>"Touriste"); $Etablissement = array( "??"=>"??", "AUF"=>"AUF", "Ecole Royale d'Administration"=>"Ecole Royale d'Administration", "Faculty of Business"=>"Faculty of Business", "ITC"=>"ITC", "Lycée"=>"Lycée", "Univ. Royale de Phnom Penh"=>"Univ. Royale de Phnom Penh", "Univ. Royale des Beaux-Arts"=>"Univ. Royale des Beaux-Arts", "Univ. Royale d'Agronomie"=>"Univ. Royale d'Agronomie", "Univ. des Sciences de la Santé"=>"Univ. des Sciences de la Santé", "Univ. de Droit et Siences-Eco"=>"Univ. de Droit et Siences-Eco"); $Groupe = array( "Usagers"=>"Usagers", "CNF"=>"CNF", "Admin"=>"Admin"); //================Array to select box================================================ function ArrayToSelectBox($arr,$sel = '',$usekey=1,$nullvalue='') { while (list( $key, $val ) = each($arr)) { if($sel && $usekey && ($key == $sel || is_array($sel) && in_array($key,$sel))) { $select_v=" selected='selected'"; } else if ($sel && !$usekey && ($val == $sel || is_array($sel) && in_array($val,$sel))) { $select_v=" selected='selected'"; } else { $select_v=''; } if($nullvalue != '') { if ($key == $nullvalue) { $key = ''; } } if ($usekey == 1) { echo "\n"; } else { if(($nullvalue != '') && ($key == '')) { echo "\n"; } else { echo "$val\n"; } } } } //---------------------Encrypt Password--------------------------------------------------- function EncryptPsWord($password) { mt_srand((double)microtime()*1000000); $salt = mhash_keygen_s2k(MHASH_SHA1, $password, substr(pack('h*', md5(mt_rand())), 0, 8), 4); $hash = "{BBCSR}".base64_encode(mhash(MHASH_SHA1, $password.$salt).$salt); return $hash; } //---------------------Decrypt Password--------------------------------------------------- function DecryptPsWord($password, $hash) { $hash = base64_decode(substr($hash, 6)); $original_hash = substr($hash, 0, 20); $salt = substr($hash, 20); $new_hash = mhash(MHASH_SHA1, $password . $salt); if (strcmp($original_hash, $new_hash) == 0){ // ... do something because your password is valid ... /*echo"Bravo.......!!
"; echo $original_hash."
"; echo $new_hash;*/ return 1; }else{ //echo 'Unauthorized: Authorization has been refused for the credentials you provided. Please login with a valid username and password.'; return 0; //... be sure to clear your session data ... } } //----------------------One more to work with--------------------------------------------- //--Veuillez m'aider pour améliorer cette fonction--et envoyer à tclyit@gmail.com //--------Vos critiques sont bienvenues!!---------------------------------------- //----------Encrypt---------------------------- function encrptPwd($string, $key) { $result = ''; for($i=0; $i