Advertisement
tok124

votefunction

Apr 16th, 2015
259
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3. @include('../config/db_conf.php');
  4.  
  5. $conn = mysqli_connect($host, $dbuser, $dbpass, $authdb);
  6.  
  7. $points = $_POST['site'];
  8.  
  9. $sql = "UPDATE account SET vp = vp+$points WHERE username = '" . $_SESSION['username'] . "'";
  10.  
  11. if ($conn->query($sql) === TRUE) {
  12.     header('location: ../?p=vote');
  13. } else {
  14.     echo "Error updating record: " . $conn->error;
  15. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement