Hi all
I have a shoutbox system on my web site HOME PAGE.
when user submit a shout that screen will be refresh and then
he can see the shout in shoutbox.
The problem is lots of users press [F5] to refresh the screen
to see the new shouts all the time!
when you do that exactly after submiting a form, browser will
ask you you are submiting the same data , are you sure you want
to contiue and sadly all of users answer YES to it!
in this case we will have tons of repeating shouts in shoutbox!
I know one sulotion for this is like directing user to another page
after submiting the form and redirect him to home page again so
data in form will be deleted!
but I dont wanna do that for some reason.
so is there any way to clean the data from FORM after submiting
the data by users?
Refresh problem (when user submit data)
Moderators: egami, macek, gesf
- Alexej Kubarev
- Site Admin
- Posts: 2213
- Joined: Fri Mar 05, 2004 7:15 am
- Location: Täby, Stockholms län
- Contact:
In case you dont want to do like ruturajv said:
Make a post on the same page an then simply header-redirect to the same page..
Make a post on the same page an then simply header-redirect to the same page..
Code: Select all
if($_POST){
#saving to the database here
/*......*/
header("Location: ".$_SERVER['PHP_SELF']);
}
#Here you may have whatever you want to..
- Alexej Kubarev
- Site Admin
- Posts: 2213
- Joined: Fri Mar 05, 2004 7:15 am
- Location: Täby, Stockholms län
- Contact: