PcKiller Posted December 10, 2003 Report Share Posted December 10, 2003 Kā var ilogoties no standarta autorizācijas formas: if (!isset($PHP_AUTH_USER)) { header('<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">'); header('WWW-Authenticate: Basic realm="Tikai administrātoriem"'); header('HTTP/1.0 401 Unauthorized'); echo "Nepareizs lietotājvārds/parole!"; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != root) || ($PHP_AUTH_PW != root)) { header('<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">'); header('WWW-Authenticate: Basic realm="Tikai administrātoriem"'); header('HTTP/1.0 401 Unauthorized'); echo "Access denied!"; exit; } else { jo ejot atkal uz administratīvo daļu, vairs neprasa ne paroli, ne lietotāja vārdu.http://php.lv/f/style_images/1/icon8.gif http://php.lv/f/style_images/1/icon8.gif Link to comment Share on other sites More sharing options...
Venom Posted December 10, 2003 Report Share Posted December 10, 2003 kaut ko tu te "perebor$iji", bet buutiibaa vajadzeetu buut otrreiz nosuutot header('HTTP/1.0 401 Unauthorized'); un uzreiz redirektu kaut kur citur ;) Link to comment Share on other sites More sharing options...
Recommended Posts