Advertisement
tok124

vote_function

Apr 17th, 2015
225
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3. $vp = $_POST['vp'];
  4.  
  5. if(isset($_POST['votetest'])) {    
  6.     $vote_last_time = "SELECT vote_time FROM vote_cooldown WHERE account = '" . $_SESSION['username'] . "'";
  7.     if($vote_last_time >= time() - 60 * 60 * 12) {
  8.     $new_time = "UPDATE `vote_cooldown` SET vote_time=now() WHERE account = '" . $_SESSION['username'] . "'";
  9.     $addvp = "UPDATE auth.account SET vp = vp+$vp WHERE account = '" . $_SESSION['username'] . "'";
  10.     } else {
  11.         echo "You can't vote now";
  12.     }
  13. }else{
  14.     echo "Button have not been clicked";
  15. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement