Hi,
Below is the following code with all the debugging code
still in there.
I enter what I KNOW is the right username/password, however
php dosent think so, The unam/pwd is stored in a plaing text
"auth.txt", with the "
username
newline
password
newline
newline
but php dose'nt seem to read them in properley, the method
im using has worked for POST VARS to scalar testing in another sript
here is the code:
<?php
header(" Basic realm=\"Lan/Game party Admin\""
#header("HTTP/1.0 401 Unauthorized"
$uname = $PHP_AUTH_USER;
$pword = $PHP_AUTH_PW;
if(($auth = file("auth.txt") != NULL)
{
#trim("$auth", "\n"
$i = 0;
foreach($auth as $conf)
{
if($conf == "\n"
{
continue;
}
#$pcnf = $auth[++$i];
print("$conf<br>"
#($uconf, $pconf) = preg_split(/\n/, $conf[$i++]);
#trim("$conf", "\n"
#print("<br>$pcnf"
if("$conf\n" == $uname && "$pcnf\n" == $pword)
{
$confirmed=1;
?>
<b><i> IF SUCESS HTML OUTPUT HERE</i></b>
<?php
break;}}}
if($confirmed != 1)
{
?>
<b><i> UNSUCESSFUL OUTPUT HERE</i></b>
<?php
print("<br>$uname<br>$pword"
$fp = fopen("auth.txt", "a+"
fputs($fp, "$uname\n$pword\n\n"
} ?>
skottieb
Below is the following code with all the debugging code
still in there.
I enter what I KNOW is the right username/password, however
php dosent think so, The unam/pwd is stored in a plaing text
"auth.txt", with the "
username
newline
password
newline
newline
but php dose'nt seem to read them in properley, the method
im using has worked for POST VARS to scalar testing in another sript
here is the code:
<?php
header(" Basic realm=\"Lan/Game party Admin\""
#header("HTTP/1.0 401 Unauthorized"
$uname = $PHP_AUTH_USER;
$pword = $PHP_AUTH_PW;
if(($auth = file("auth.txt") != NULL)
{
#trim("$auth", "\n"
$i = 0;
foreach($auth as $conf)
{
if($conf == "\n"
{
continue;
}
#$pcnf = $auth[++$i];
print("$conf<br>"
#($uconf, $pconf) = preg_split(/\n/, $conf[$i++]);
#trim("$conf", "\n"
#print("<br>$pcnf"
if("$conf\n" == $uname && "$pcnf\n" == $pword)
{
$confirmed=1;
?>
<b><i> IF SUCESS HTML OUTPUT HERE</i></b>
<?php
break;}}}
if($confirmed != 1)
{
?>
<b><i> UNSUCESSFUL OUTPUT HERE</i></b>
<?php
print("<br>$uname<br>$pword"
$fp = fopen("auth.txt", "a+"
fputs($fp, "$uname\n$pword\n\n"
} ?>
skottieb