autenticazione con php

antonia

Nuovo Utente
18 Nov 2009
7
0
0
I meccanismi di Autenticazione HTTP sono disponibili in PHP solo quando questo viene usato come un modulo di Apache e non CGI. Io to usando il server IIS di Microsoft , esiste comunque qualcosa di simile al codice che sto postando , che posso utilizzare?

<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="Il mio realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Messaggio da inviare se si preme il tasto Cancel';
exit;
} else {
echo "<p>Ciao {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>Hai inserito {$_SERVER['PHP_AUTH_PW']} come tua password.</p>";
}
?>
 
continua a darmi accesso negato

:hammer:Geazie mille ma mi da accesso negato... ti invio anche il file di configurazione, magari ci sarà qui qualche errore

<?php
define('HTTP_SERVER', 'http://www.shopwipr.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTP_CATALOG_SERVER', 'http://www.shopwipr.com');
define('HTTPS_CATALOG_SERVER', '');
define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
define('DIR_FS_DOCUMENT_ROOT', '/www/MW_qPXRyccyG/shopwipr.com/'); // where the pages are located on the server
define('DIR_WS_ADMIN', '/admin/'); // absolute path required
define('DIR_FS_ADMIN', '/www/MW_qPXRyccyG/shopwipr.com/admin/'); // absolute pate required
define('DIR_WS_CATALOG', '/'); // absolute path required
define('DIR_FS_CATALOG', '/www/MW_qPXRyccyG/shopwipr.com/'); // absolute path required
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

// define admin user/password **/
define('ADMIN_USERNAME', 'root');
define('ADMIN_PASSWORD', 'user');

// define our database connection

define('DB_SERVER', 'mysql.shopwipr.com'); // eg, localhost - should not be empty for productive servers
define('DB_SERVER_USERNAME', '*********');
define('DB_SERVER_PASSWORD', '********');
define('DB_DATABASE', 'shopwipr_com_switch');
define('USE_PCONNECT', 'false'); // use persisstent connections?
define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' **/
?>


l'ho copiato da un altyro progetto, ma quando lavoravo con aphace non mi creava alcun problema
 
dovresti controllare le impostazioni di IIS, l'autore dello script scrive anche:
Also, make sure you turn
// off ALL IIS authentication options, incl
// uding the default "Integrated Windows Au
// thentication". Leave only Anonymous Acce
// ss checked, or this will not work.
 
se non hai accesso al file di configurazione del Web server devi chiedere al tuo provider di hosting
 

Discussioni simili