I have asked this board on three seperate occassions how to redirect someone with the header function. I have gone to the manual and I think it is just my coding I guess, because I can't get it to work- here is the code: I have made sure that my include file [that has the hostname,pass,and user] has no stry spaces, line breaks and it has NO HTML in it at all.
<?php
#####################################################
This program verifies the user/pass combination
#####################################################
$enteruser = trim($enteruser);
$enterpass = trim($enterpass);
include("this file is outside the root");
$Link1 = mysql_connect($Host,$User,$Password);
mysql_select_db($DBName, $Link1);
$Query1 = "SELECT * from auth where user = '$enteruser'";
$Result1 = mysql_query($Query1,$Link1);
$Array1 = mysql_fetch_array($Result1);
$veriuser = $Array1["user"];
$veripass = $Array1["pass"];
if ($enterpass == "$veripass" && ($enteruser == "$veriuser")) {
header(Location:"http://www.somewhere/directory/file.htm");
}
else
{
print("<bgcolor = 'red' font color ='yellow' font size ='6'><center><b>NOT AUTHORIZED!!<br><br>Please go back and try again<br><a href='/login.htm'>Click Here to go back!");
exit;
}
?>
I don't know if this has anything to do with it, but this is the program that basically authorizes a user, the variables were passed by an HTML page- does that affect the header function at all?