View Full Version : PHP MySQL and Header Redirection Problem! (Please Help)

09-11-2005, 09:07 AM
Well the error with this, is the header("Location: ".$url); doesn't work, and even when I use a Javascript version it still doesn't work. I think it might have to do witht he enclosing PHP. Please help me. Here is the code that has the error.


$username = "****";
$password = "****";
$database = "****";

if ($_GET['go'] !== "") {

@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM go WHERE id='$go'";



while ($i < $num) {


echo '<script language="JavaScript">'; //Testing JavaScript
echo '<!--';
echo 'window.location="'.$url.'"';
echo '//-->';
echo '</script>';

$header = header("Location: ".$url); // Not testing anymore


else {


09-11-2005, 11:09 AM
Take away the $header =

09-11-2005, 01:22 PM
Also, header MUST be called before ANY data is outputted on the screen (before any echo's, print's, ect.)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum