Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Password

Script semplicissimo per la protezione di una pagina.




<?php
if(!isset($PHP_AUTH_USER))
{
    Header("WWW-Authenticate: Basic realm=\"Xavier Protection\"");
    Header("HTTP/1.0 401 Unauthorized");
    echo "Text to send if user hits Cancel button\n";
    exit;
}
else
{
    $user_passwords = array (
    "user1" => "password1",
    "user2" => "password2",
    "user3" => "password3",
    "user4" => "password4"
    );
    if (($PHP_AUTH_USER == "") || ($PHP_AUTH_PW == ""))
    {
        Header("HTTP/1.0 401 Unauthorized");
        echo "Sorry, could find your password!";
        exit;
    }
    else if (strcmp($user_passwords[$PHP_AUTH_USER],$PHP_AUTH_PW) == 0)
    {
        echo "This is the password protected page.";
        exit;
    }
    else
    {
        Header("HTTP/1.0 401 Unauthorized");
        echo "Sorry, could find your password!";
        exit;
    }
}
?>


Scarica il Codice...


Stampa la pagina


 








Inizio pagina

risorse per webmaster

php

php

php, mail, database, banner
php, banner,

Vai nel sito Morpheusweb.it - Risorse per Webmaster troverai quello che stai cercando
php, banner,
Nel nostro sito molte informazioni: "Morpheusweb.it - Risorse per Webmaster" tratta di php, script, forms, mail, database
click here se non sei reindirizzato automaticamente al nostro sito.

php, script, banner, mail, database, , ,