Spookster
12-10-2002, 06:26 AM
This is driviing me nuts. I think i've stared at this too long and now can't see the problem. This is a login page I created:
<?php
$userid = $_POST["userid"];
$password = $_POST["password"];
$submit = $_POST["submit"];
//process login
if(isset($submit)){
include("includes/login_module.php");
$login_msg = user_login($userid, $password);
if($login_msg == "validated"){
header("Location: cp.php");
}//end if
}//end if
// show login form
include("includes/header_no_access.php");
?>
<!-- begin login form -->
<table width="264" border="0" cellspacing="0" cellpadding="3">
<form name="form1" method="post" action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">
<tr bgcolor="#006699">
<td width="80" class="pageContentWhite">User ID</td>
<td width="172"><input name="userid" type="text" id="userid"></td>
</tr>
<tr bgcolor="#006699">
<td class="pageContentWhite">Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr bgcolor="#006699">
<td> </td>
<td><input type="submit" name="submit" value="Login"></td>
</tr>
</form>
</table>
<!-- end login form -->
<?php
echo $login_msg;
include("includes/footer.php");
?>
For some reason the header is not working when the login has been validated.
if($login_msg == "validated"){
header("Location: cp.php");
}//end if
I know the login is being validated as I checked that by putting an echo statement in there to make sure. I get no php errors. It just stays on the login page.
????
<?php
$userid = $_POST["userid"];
$password = $_POST["password"];
$submit = $_POST["submit"];
//process login
if(isset($submit)){
include("includes/login_module.php");
$login_msg = user_login($userid, $password);
if($login_msg == "validated"){
header("Location: cp.php");
}//end if
}//end if
// show login form
include("includes/header_no_access.php");
?>
<!-- begin login form -->
<table width="264" border="0" cellspacing="0" cellpadding="3">
<form name="form1" method="post" action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">
<tr bgcolor="#006699">
<td width="80" class="pageContentWhite">User ID</td>
<td width="172"><input name="userid" type="text" id="userid"></td>
</tr>
<tr bgcolor="#006699">
<td class="pageContentWhite">Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr bgcolor="#006699">
<td> </td>
<td><input type="submit" name="submit" value="Login"></td>
</tr>
</form>
</table>
<!-- end login form -->
<?php
echo $login_msg;
include("includes/footer.php");
?>
For some reason the header is not working when the login has been validated.
if($login_msg == "validated"){
header("Location: cp.php");
}//end if
I know the login is being validated as I checked that by putting an echo statement in there to make sure. I get no php errors. It just stays on the login page.
????