Re: header()
- From: "Andrew G. Koptyaev" <koptyaev@xxxxxxxxx>
- Date: Sun, 30 Nov 2008 00:14:02 +0300
"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> ???????/???????? ? ????????
?????????: news:ggsap4$4fl$1@xxxxxxxxxxxxxxxxxxxxxx
Andrew G. Koptyaev wrote:
"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.
It sounds like your flow planning needs some work. You need to make a
decision as to what you want to do - put out messages(s) or redirect. As
you found, you can't do both.
However, you should be able to make a decision BEFORE either is done, then
do one or the other.
All working. I have are both messagess and reload but I have one qestion:
Is was any error in some browser if I put meta reload not to head of html?
Thank you! :-)
.
- References:
- header()
- From: Andrew G. Koptyaev
- Re: header()
- From: Anthony Papillion
- Re: header()
- From: Andrew G. Koptyaev
- Re: header()
- From: Jerry Stuckle
- header()
- Prev by Date: Re: header()
- Next by Date: Re: php form and ssi
- Previous by thread: Re: header()
- Next by thread: include file
- Index(es):