Jump to content

Parola Pentru Accesarea Unei Pagini Web


Recommended Posts

Posted

restrictedareasignpv6.jpg

Aveti o pagina in site-ul dumneavoastra pe care vreti sa o restrictionati, si vreti sa faceti asta fara .htaccess?

Atunci nu trebuie sa folositi decat urmatorul cod de mai jos:

<?php 
if (
(!isset($_SERVER['PHP_AUTH_USER'])) || (!isset($_SERVER['PHP_AUTH_PW'])))
{
header ('WWW-Authenticate: Basic realm="php4"');
header ('HTTP/1.0 401 Unauthorized');
echo 'Pentru accesarea continutului este necesara o autentificare!';
exit;
}
else
{
echo "<html><head>";
echo "<title>Autentificare</title>";
echo "</head><body>";
echo "<p>Salut <b><i>{$_SERVER['PHP_AUTH_USER']}</i></b>!</p>";
echo "<p>Parola introdusa este <b><i>{$_SERVER['PHP_AUTH_PW']}</i></b>.</p>";
echo "</body></html>";
}
?>[/html]

:pct2:

Te-ai inregistrat? Ne-ar placea sa te prezinti.

Cum pot sustine forumul?
Cumpara de la eMag folosind acest link.
--------------------
oG2BN9d.gifse1WdXd.gifQG6MtmI.gifRHYjDzD.gifG5p1wui.gif

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.