Re: Header Problems

From: Date: Wed, 13 Dec 2000 04:05:42 +0000
Subject: Re: Header Problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30015@lists.php.net to get a copy of this message
That message indicates that something, somewhere, somehow, sent content to the browser. It could be as simple as a blank line before your first <?php or it could be an auto_prepend file from php.ini or a blank line after ?> in an included file. But *something* is sending some sort of content (space, line, HTML) before that header function. ----- Original Message ----- From: "David Smith" <wreckrman2@combatfs.com> Newsgroups: php.general Sent: Tuesday, December 12, 2000 6:03 PM Subject: [PHP] Header Problems > Below is my code, download.php, used to count the number of times one > downloads the file then redirects them to the zip file. The problem is I > keep getting that awful error about the headers all ready been created, > there is no header info in the script. I have tried several JavaScript code > and meta tag refreshing to complete the task but those leave a blank white > page in the background once a user requests the file. When my site was in > ASP I made this to open in a new window then once the zip download box > opened the new window disappeared only I can't get this to happen in PHP. I > am sure that it will if this header function would work properly. Any > sugestions? > > David Smith > http://www.combatfs.com > > <?php > > $connection = mysql_connect ("localhost", "combat", "******"); > if ($connection == false){ > echo mysql_errno().": ".mysql_error()."<BR>"; > exit; > } > > $query = "select * from warbirds_db WHERE FileID ='$FileID'"; > $result = mysql_db_query ("combat", $query); > > if ($result){ > > $numOfRows = mysql_num_rows ($result); > for ($i = 0; $i < $numOfRows; $i++){ > $FileID = mysql_result ($result, $i, "FileID"); > $FileType = mysql_result ($result, $i, "FileType"); > $FileURL = mysql_result ($result, $i, "FileURL"); > $FileCount = mysql_result ($result, $i, "FileCount"); > > } > > $Count = ($FileCount + 1); > > $update_query = "UPDATE warbirds_db SET FileCount = '$Count' WHERE FileID = > '$FileID'"; > $update_result = mysql_db_query ("combat", $update_query); > > header ("Location: > http://www.combatfs.com/ftp/$FileType/$FileURL"); > > } > else{ > echo mysql_errno().": ".mysql_error()."<BR>"; > } > > mysql_close (); > > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#30015) next »