Jump to content

stop people from hacking with unset


Monkuar

Recommended Posts

if ($indovina!=$indovinata) {
if ($tentativi>=6) {
  echo ("\n<p>Sorry, you hanged yourself. The word you had to guess was: ".$indovina."</p>\n");
}
else {
  $scelt = preg_split('//', $scelte, -1, PREG_SPLIT_NO_EMPTY);
  echo ("\n<p>\n");
  foreach ($alfabeto as $lettalf) {
   $contrl = false;
   foreach ($scelt as $lett) {
    if (!strcasecmp ($lettalf, $lett)) {
     $contrl = true;
    }
   }
   if ($contrl) {
    print (' <img src="images/lr_'.$lettalf.'.gif" style="border:0;width:20px;height:20px" alt="'.$lettalf.'" />');
   }
   else {
    print (' <a href="'.$_SERVER['PHP_SELF'].'?letter='.$lettalf.'"><img src="images/lb_'.$lettalf.'.gif" style="border:0;width:20px;height:20px" alt="'.$lettalf.'" /></a>');
   }
   if ($lettalf=='m') echo ("\n <br />");
   echo ("\n");
  }
  echo ("</p>\n"); 
}
}
else if ($indovinata){
echo ("\n<p>Congratulations! You guessed the word.</p>\n");
$DB->query("UPDATE ibf_members set gold=gold+5
			WHERE id = {$ibforums->member['id']}");
}

 

 

Look at the bottom, ok so if the person wins the hangman game, it will show "Congrats" but then people will just beable to refresh the page, and that query will run again and again and that person will gain +5 gold each time....we need to fix this!! any help?

Link to comment
https://forums.phpfreaks.com/topic/254590-stop-people-from-hacking-with-unset/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.