Re: header()



"Anthony Papillion" <papillion@xxxxxxxxx> ???????/???????? ? ????????
?????????:
news:78a9bcc1-b43c-4ab8-99be-6cf0240c4430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Nov 29, 2:11 pm, "Andrew G. Koptyaev" <kopty...@xxxxxxxxx> wrote:
I have software catalog site.
If I want to download some software I press button with link on page and
goto to php script which increment download value in database and then I
want
to redirect to file but all headers already outputed to browser and I
can't
use header() function.

I'm not sure why you can't use the header function after a database
query. Doing a query doesn't send any HTTP headers to the browser by
itself. I'd say look at the structure of your script and page. You can
probably do it better where you can use header() in your script.

For example:

$sql = "UPDATE download_count SET download_count='whatever'";
header("Location: downloadprogram.php");

That should work with no problems.

Anthony


Yes. I first make as you say but late I make page with additional info
like alterntive message with link for manual download and also another
useful info. And this page include header. Therefore a can't use
header() in this page.


.


Quantcast