Stop resending form information
Moderator: General Moderators
Stop resending form information
[removed]
Last edited by brandon on Tue Jul 14, 2015 4:35 pm, edited 1 time in total.
This should be fun
Code: Select all
<?php
if ( isset($_POSTї'submit']) )
{
/* Insert Data Here into Database */
/* Forward your visitors onto the page you want them on */
header("Location: name_of_page");
}
/* Your page or whatever you want. */
?>The key here is the use of header(). Just make sure you are not outputing anything before this.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
i would reccomend making it so posting the name "name" and the message "message" won't work, because some people just like to press the submit button over and over and
name
message
will pop up alot...
also you could just put a little link at the bottom like
<a href="<?=$PHP_SELF;?>">Refresh!</a>
or in php
echo "<a href="$PHP_SELF">Refresh!</a>";
name
message
will pop up alot...
also you could just put a little link at the bottom like
<a href="<?=$PHP_SELF;?>">Refresh!</a>
or in php
echo "<a href="$PHP_SELF">Refresh!</a>";
Ok I dunno about the code for this cause I dunno about mysql.... but personally I'd just always check the data someone sends with the last data sent.. then in case they send the exact same thing twice... give them a warning or just discard the data.
I mean after a submit get tha data last submitted and do a
if ($newdata != $olddata){
process everything
}
That should be easy enough.
I mean after a submit get tha data last submitted and do a
if ($newdata != $olddata){
process everything
}
That should be easy enough.