PDA

View Full Version : error with my shoutbox, if you refresh it re-posts your msg


Shuriken-UK
Mon 4th Aug '03, 7:46pm
Im having this problem with my shoutbox I just finnished, when you hit refresh (after posting a message) it comes up with a box "Cannot refresh without re-sending information"

is there a line of code that kills this. Sessions perhaps?

Hellcat
Mon 4th Aug '03, 11:09pm
If you submitted a form and then hit F5 (or any reload trigger) the Browser will send all data AGAIN (to ensure you get the same result as before).
The Broeser is just telling you that, and as it subits your last data again, your last entry is added once more to the shout box.

AFAIK there is no way of avoiding that.

Just navigate to the shoutbox again, avoiding "reload".

Reloading dynamic pages, that require a form to be filled out before is a bad plan anyway IMHO.

Icheb
Tue 5th Aug '03, 12:47am
That problem is easy to solve. Let's say your shoutbox resides in www.domain.com/forum/shoutbox.php (http://www.domain.com/forum/shoutbox.php) , do a

header('LOCATION: /forum/shoutbox.php');

after you insert the "shout" into the db.