Header help

From: DaRemedy (demonnet_at_btinternet.com.nospam)
Date: 09/26/04


Date: Sun, 26 Sep 2004 19:23:42 +0000 (UTC)

Hiya, just need help with PHP headers.

I have an index php page which has the following code within a header
redirect:

<?php
if ( empty($_GET['month']) )
if (empty($_GET['year']) )
{
$month = date(n);
$year = date(Y);
header("Location: index.php?month=$month&year=$year");
}
?>

On the same index.php page, I have a shoutbox (include file) which inputs
the content of the shoutbox form into a database. After the user fills out
the form, I want the index page to refresh again because if I leave it as it
is and a user inputs info into the form, if they press refresh, the form
resubmits thus recording two entries into the shoutbox, or however many
times refresh is pressed.

When I add a header redirect into the shoutbox include file, once the user
clicks on send, index.php throws a headers cannot be sent error message.

Can anyone help?

Cheers.



Relevant Pages

  • Header help
    ... just need help with PHP headers. ... I have a shoutbox which inputs ... When I add a header redirect into the shoutbox include file, ...
    (comp.lang.php)
  • RE: [PHP] Help with IF ELSE
    ... [PHP] Help with IF ELSE ... In fact, if I have to redirect, and I am not sure about headers are ... This just outputs a JS call to a redirect if headers have already been sent and provides a link if the user has disabled JS ... To unsubscribe, visit: http://www.php.net/unsub.php ...
    (php.general)
  • Re: Newbie - Is there a PHP equivalent of Server.Transfer (in ASP.NET)
    ... Sorry for the newbie question, but I've only been at PHP for a couple of days, and I'm trying to get some stuff done as fast as possible. ... In ASP.NET there is a method called Server.Transfer which transfers the request to a different page from the one that the user requested, but without doing a redirect. ... I don't want the headers altered as I want the search engines to see the page with the original URL. ...
    (comp.lang.php)
  • Re: [PHP] Cookies and sent headers
    ... what he sees is a warning emitted by PHP, his redirect is done using JavaScript. ... Its not the problem of cookies. ... Yet I'd like to move these into cookies but I always get an error about sent headers. ...
    (php.general)
  • Re: Newbie - Is there a PHP equivalent of Server.Transfer (in ASP.NET)
    ... stuff in PHP. ... request to a different page from the one that the user requested, ... The user gets sent headers as though they were ... ...but these seems to be a redirect, which is not the same thing. ...
    (comp.lang.php)