Universal Gaming League

almost 14 years ago

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.

almost 14 years ago

How do you mean?

almost 14 years ago

"Double Post"

almost 14 years ago


 Xel<3J
ironic :O

 Bradlewis
Libra Whore
almost 14 years ago

lmao @ the double post :P

almost 14 years ago


 QCK
I know :)

almost 14 years ago

Haha the double post was so funny but you are a machine when it comes to being helpful!

almost 14 years ago


 jSEXY
Sorry mate I'm a machine :P just wanna the best for the community and UNGL. Just fixing and helping admins will be a first step for us all.

over 13 years ago

yes, please fix double posting!

 Phantom
CS Admin
over 13 years ago


 prassel
How did you even manage to find this...

over 13 years ago



 Phantom
more to the point why?

over 13 years ago

i don't understand, can you explain in more detail? :)

over 13 years ago

This will be implemented in the future. We have taken note of this, but site coders have a little more on their plates right now. Which is understandable between University, Work, and well.. Seeing the outdoors from time-to-time. Please be patient. It's just the time of the year where things slowed down as was expected. This has not and will not be ignored.

Thanks, as always, for your community input.

//Xano

over 13 years ago



 Xano
how dare you go outside !!!!! we both know you should be spending your time feeding basement cat :P (no worries ungl will get there when they get there)

over 13 years ago



 Xano
outside is a lie, just like cake

 Phantom
CS Admin
over 13 years ago


 wapps
The cake wasn't a lie though :(

over 13 years ago

How very dare I... Who do I think I am.. LEAVING MY ROOM... PFFFFFFFFFFFFF

over 13 years ago


 Xel<3J
or we could like not refresh the page straight after u post ure message and it wouldt double post TAA-DAHH !

Reply