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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.