D
D
Danil Isaev2015-02-14 23:14:06
PHP
Danil Isaev, 2015-02-14 23:14:06

How to create an authorization for individual pages?

There is a simple catalog site with a separate editing page. How to make authorization for the edit page? Preferably without using mysql and registration.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2015-02-14
@d4h1i15438

if ($_SERVER['PHP_AUTH_USER']<>'login' OR $_SERVER['PHP_AUTH_PW']<>'pass')
{
    Header('WWW-Authenticate: Basic realm="Admins"');
    Header("HTTP/1.0 401 Unauthorized");
    exit;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question