Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <?php
  2. $host="";
  3. $user="";
  4. $password="";
  5. $database="characters"; //Your character database
  6. if(($_COOKIE['vote']) != '0') //Will add later - Knindza
  7. {
  8. if(!empty($_POST['name']))
  9. {
  10. mysql_connect($host,$user,$password);
  11. @mysql_select_db($database) or die( "Unable to select database");
  12. $name = mysql_real_escape_string($_POST['name']);
  13. $query="SELECT * FROM characters WHERE name='$name' LIMIT 1";
  14. $result = mysql_query($query);
  15. if($row = mysql_fetch_array($result))
  16. {
  17. @@ $guid = $row['guid'];
  18. @@ $item = 20815;
  19. @@ mysql_query("INSERT INTO mail(sender, receiver, subject, body, stationary, money, item_id, item_stack) VALUES ($guid, $guid, 'Thankyou for voting!', 'Use this item to get vote rewards from the votereward vendors in the malls. Vote again in 12 hours', 0, 0, $item, 1");
  20. echo "Thank you for voting!";
  21. echo "<script language=javascript>setTimeout(\"location.href='" . "#" . "'\",3000);</script>";
  22. }
  23. else
  24. {
  25. echo "A char with that name was not found.";
  26. }
  27. mysql_close();
  28. }
  29. else
  30. {
  31. ?>
  32. Vote for Shadowburn and get rewards! <br />
  33. <form method='post' action='vote1.php'>
  34. Character Name:<input type='text' name='name' />
  35. <input type='submit' value='Vote!' />
  36. </form>
  37. <p>
  38. <?php
  39. }
  40. }
  41. else
  42. {
  43. echo "You already voted! You can vote once every 12 hours. Thank you :)";
  44. }
  45. ?>
  46. </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement