Hi,
Okay, here's the problem.
the /admin of the site im greating asks for Authentication
thats fine, all authenticates, if I refresh I dont get asked to re-authenticate myself, I have also pot a logout submit button on the page im testing witw, when the button calls "logout.php" I want it to wipe the data in $PHP_AUTH_USER, how can I do this, all attmepts so far have been to no avail and the documentation isnt helping me.
On the first note how could I get php to wipe $PHP_AUTH_* on a browser refresh. Shuting down and reloading the browser does ask for (re)-authentication.
here is the code I have so far:
------------------>logout.php
<?php
$user = include("admin.php" #refrence returned from auth.php
unset($user);
$user = FALSE;
?>
------------------>admin.php
<?php
require("auth.php"
$user =& $PHP_AUTH_USER; #create a refrence to $PHP_AUTH_USER
$conf = (auth($PHP_AUTH_USER, $PHP_AUTH_PW));
if($conf == 1)
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Search for Participant</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
</head>
<body bgcolor="darkBlue" text="white" link="red" alink="yellow" vlink="lightGray">
<table width="100%" cellspacing=0 border=2 cellpadding=0 align="center" bgcolor="darkBlue">
<tr>
<td><h1><i><u>Enter a email of Participant to search</u></i></h1></td>
</tr><tr>
<td><hr><form action="usearch.php" method="POST" target="_self">
<input type="text" name="user" value="Enter Name Here" size=30 maxlength=50>
<br><input type="submit" name="search" value="Search" size=10 maxlength=10>
<hr>
</td><td width="20%" colspan=1 rowspan=1 align="middle" valign="center" bgcolor="white">
<?php
print("<form action=\"logout.php\" method=\"GET\" target=\"_self\">"
?>
<input type="submit" name="logout" value="logout" size=10 maxlength=10 alt="logout" align="middle">
</form>
</td>
</form></td>
</tr>
</table>
</body>
</html>
<?php
}
return $user; #RETURN THE REFRENCE TO $PHP_AUTH_USER to logout.php when it calls "include("admin.php"
?>
skottieb
Okay, here's the problem.
the /admin of the site im greating asks for Authentication
thats fine, all authenticates, if I refresh I dont get asked to re-authenticate myself, I have also pot a logout submit button on the page im testing witw, when the button calls "logout.php" I want it to wipe the data in $PHP_AUTH_USER, how can I do this, all attmepts so far have been to no avail and the documentation isnt helping me.
On the first note how could I get php to wipe $PHP_AUTH_* on a browser refresh. Shuting down and reloading the browser does ask for (re)-authentication.
here is the code I have so far:
------------------>logout.php
<?php
$user = include("admin.php" #refrence returned from auth.php
unset($user);
$user = FALSE;
?>
------------------>admin.php
<?php
require("auth.php"
$user =& $PHP_AUTH_USER; #create a refrence to $PHP_AUTH_USER
$conf = (auth($PHP_AUTH_USER, $PHP_AUTH_PW));
if($conf == 1)
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Search for Participant</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
</head>
<body bgcolor="darkBlue" text="white" link="red" alink="yellow" vlink="lightGray">
<table width="100%" cellspacing=0 border=2 cellpadding=0 align="center" bgcolor="darkBlue">
<tr>
<td><h1><i><u>Enter a email of Participant to search</u></i></h1></td>
</tr><tr>
<td><hr><form action="usearch.php" method="POST" target="_self">
<input type="text" name="user" value="Enter Name Here" size=30 maxlength=50>
<br><input type="submit" name="search" value="Search" size=10 maxlength=10>
<hr>
</td><td width="20%" colspan=1 rowspan=1 align="middle" valign="center" bgcolor="white">
<?php
print("<form action=\"logout.php\" method=\"GET\" target=\"_self\">"
?>
<input type="submit" name="logout" value="logout" size=10 maxlength=10 alt="logout" align="middle">
</form>
</td>
</form></td>
</tr>
</table>
</body>
</html>
<?php
}
return $user; #RETURN THE REFRENCE TO $PHP_AUTH_USER to logout.php when it calls "include("admin.php"
?>
skottieb