Like you see there's a regular problem with fixing the double posting when you're refresh the page, going back to the previous page,...
It's very simple but I think it's for the webmaster of UNGL.
When you're clicking on the "Post" button it's send a php code like this (example)
[quote]// submit comment
if( $name && $comment )
{
$query = "INSERT INTO comments (name,email,comment,id) VALUES
('$name','$email','$comment',$id)";
mysql_query($query,$db);
}
else if( $submit )
{
echo 'missing fields';
}
// display comments
$result = mysql_query("SELECT * FROM comments WHERE id='$id' ORDER BY
timestamp DESC");
$num = mysql_numrows($result);
for($i=0; $i<$num; $i++)
{
$name = mysql_result($result,$i,"name");
$comment = mysql_result($result,$i,"comment");
echo '<br />';
if( $email )
echo '<b>'.$name.':</b>';
if( $email )
echo '</a>';
echo '<br />'.$comment;
}
mysql_close();
// display form
echo '
<form action="?id='.$id.'" method="POST">
<label for="name">Name</label>
<input name="name" type="text" /><br />
<label for="comment">Comment</label>
<textarea name="comment"></textarea><br />
<input name="submit" type="submit" value="Submit" />
</form>[/quote]
Then you must change it to a newer page with like example this message
[quote]page1.php contains form
set the action to page1_process.php
page1_process.php
receives the form, does its stuff like databaseinserts.
Do not create ANY output.
End you script with something like this:
$result = urlencode("Thanks for posting!");
header ("Location: page1.php?result=".$result);
And in page1.php you could display the result if it exists in the
$_GET["result"].[/quote]
I hope you guys understand it otherwhise I gonna make pictures about it.