th2pun1sh3r Posted July 9, 2006 Share Posted July 9, 2006 Ok so ive been having issues making this script work on my website you can try it yourself..here is how it works. User goes to website clicks a link and the script runs..the user/pass box comes up and it won't take what it should.here is the script I downloaded ( I didn't make it) :<?php/******************************************************************************\* Simple Page Protect Version 1.0 ** Copyright 2000 Frederic TYNDIUK (FTLS) All Rights Reserved. ** E-Mail: tyndiuk@ftls.org Script License: GPL ** Created 02/28/2000 Last Modified 02/28/2000 ** Scripts Archive at: http://www.ftls.org/php/ ********************************************************************************//*******************************************************************************/// Necessary Variables:$LOGIN = "ftls";$PASSWORD = "demo";// En: login /password// Fr: login / mots de passe// End Necessary Variables section/******************************************************************************/function error ($error_message) { echo $error_message."<BR>"; exit;}if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $LOGIN) && ( $PHP_AUTH_PW == $PASSWORD )) ) { header("WWW-Authenticate: Basic entrer=\"Form2txt admin\""); header("HTTP/1.0 401 Unauthorized"); error("Unauthorized access...");}?> <!-- Add code of your web page here --><HTML><HEAD><TITLE>Your protected page</TITLE></HEAD><BODY BGCOLOR="white"><BR><BR><P ALIGN="Center"><FONT FACE="Arial, helvetica" SIZE="+2" COLOR="#336699"><STRONG><EM>Your protected page</EM></STRONG></FONT></P><BR><BR><BR><BR><BR><BR><BR><BR><BR><CENTER><BR><BR> <FONT FACE="Arial" SIZE=-2> <EM>© Copyright 2000 <A HREF="http://www.ftls.org/">FTLS</A> (Tyndiuk Frédéric). All rights reserved. <BR>FTLS's PHP Scripts Archive : <A HREF="http://www.ftls.org/php/">http://www.ftls.org/php/</A></EM></FONT></CENTER></BODY></HTML> Quote Link to comment https://forums.phpfreaks.com/topic/14128-need-help-with-php-auth-script/ Share on other sites More sharing options...
toplay Posted July 10, 2006 Share Posted July 10, 2006 The use of variables like $PHP_AUTH_USER requires that register_globals be on. Keep it off for security reasons and use $_SERVER['PHP_AUTH_USER'] instead.See this manual page for more details:http://us2.php.net/manual/en/features.http-auth.phpSince you didn't write the script, this topic has been moved to the third party area. Quote Link to comment https://forums.phpfreaks.com/topic/14128-need-help-with-php-auth-script/#findComment-55358 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.