Php ile Şifreleme Yöntemi

<?php
 // kullanici listesi

$kul[0]['username']="ali";
 $kul[0]['password']="1234";

$kul[1]['username']="veli";
 $kul[1]['password']="4321";

// dogrulama

function authenticate()
 {
 header( 'www-authenticate: basic realm="private"' );
 header( 'http/1.0 401 unauthorized' );
 echo 'authorization required.';
 exit;
 }

if (!isset($_server['php_auth_user']) || !isset($_server['php_auth_pw'])) { authenticate(); } else
 {
 for($i=0;$i<count($kul);$i++) { if($_server['php_auth_user']==$kul[$i]['username'] && $_server['php_auth_pw']==$kul[$i]['password']){$auth=true;}}
 if($auth !=true) {authenticate();}
 }
 ?>

1 kişi beğendi

Diğer Benzer Yazılar: