I'm in a situation where I'd like to redirect a page, but an include file earlier in the page is keeping me from doing it via the header() function, even though the include file doesn't generate any apparent output . Heres the code for the include file:
<?
function val_pwd ( $username, $password )
{
if (mysql_pconnect("localhost","user","pwd"))
{
$sql = "select * from table where handle='$username' and password=password('$password')";
$result = mysql_db_query("db", $sql);
$count = mysql_num_rows($result);
if ($count == 1){ return 1; } else { return 0;}
}
}
?>
I've tried the javascript location thing, but I notice the page takes longer to load and I get a noticeable "flash" effect. A PHP include might be workable, but I'm worried about it creating a "hall of mirrors" effect and it will require some tedious reworking of some of my session handling.
I thought before I picked my poison I'd check to see if there are any other redirection techniques people could recommend that I haven't tried yet.
Thanks in advance,
Al