Jump to content
php.lv forumi

Cik droshi ir shaadi?


ansis

Recommended Posts

Meklēju protekciju savām admin lapām. Izmēģināju visādus php sessions un cookies, bet vienmēr bija problēmas.

Tad atradu saadu:

 

<?
$username = "usr"; //set username
$password = "psw"; //set password

//Below is where the verification takes place. Try to play around with it.
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="Enter user/psw!"');
header('HTTP/1.0 401 Unauthorized');
die;

} else {

if (($_SERVER['PHP_AUTH_USER'] !== $username) || ($_SERVER['PHP_AUTH_PW'] !== $password)) {
header('WWW-Authenticate: Basic realm="Try again!"');
header('HTTP/1.0 401 Unauthorized');
die;
}
}
?>

Viss straadaa.

Mans jautaajums - cik shis ir droshi?

Link to comment
Share on other sites

  • 4 weeks later...
phpmyadmin pašam ir iekšā autentifikācija. Priekškam 2x autentificēties  :blink:

25567[/snapback]

 

nau ieksh phpMyAdmin nekaadas autentifikaacijas!

NOTE: phpMyAdmin does not apply any special security methods to the MySQL database server. It is still the system administrator's job to grant permissions on the MySQL databases properly. phpMyAdmin's "Privileges" page can be used for this.

Link to comment
Share on other sites

×
×
  • Create New...