Hi, I am having trouble with this redirect page.
It is supposed to check the mysql database for 2 values or more to redirect to a given page. Well, when i delete the "header" function, the page will go blank.
But when i use the script like it is here, it will give me this error message: "Cannot add header information - headers already sent by (blah blah blah)".
Either way it will not redirect like its supposed to, and i have researched php and mysql docs, but nothing helped.
Any suggestions? maybe a different php/mysql scripting approach?
php
<?
session_start();
// check session variable
include "../config.php";
echo "<p><font face=arial>";
mysql_connect("$server", "$db_user", "$db_pass");
mysql_select_db("$database");
mysql_query("SELECT * FROM clickthroughs");
if (mysql_num_rows > 2) {
header("Location: http://www.url.com/");
} else {
header("Location: http://www.url.com/");
}
?>
/php