Advertisement
tok124

vote_function

Apr 17th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement