View difference between Paste ID: 76bwm4Qi and rLt8WD5t
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
############################################################################
4
#                                                                          #
5
#  _    _       _     _        _______         __  ___   ___               #
6
# | |  | |     | |   | |      |__   __|       /_ |/ _ \ / _ \              #
7
# | |__| | __ _| |__ | |__   ___ | | ___  _ __ | | | | | | | |             #
8
# |  __  |/ _` | '_ \| '_ \ / _ \| |/ _ \| '_ \| | | | | | | |             #
9
# | |  | | (_| | |_) | |_) | (_) | | (_) | |_) | | |_| | |_| |             #
10
# |_|  |_|\__,_|_.__/|_.__/ \___/|_|\___/| .__/|_|\___/ \___/              #
11
#                                        | |                               #
12
#                                        |_|                               #
13
#                                                                          #
14
#                          PHP - MySQLi - OOP   by Mike                    #        
15
############################################################################
16
17
date_default_timezone_set('Europe/Amsterdam');
18
19
$sterren = 0; // Je speler krijgt nu 0 sterren bij het stemmen
20
$pixels = 100; //Je speler krijgt 100 pixels
21
$credits = 1000; //Je speler krijgt 1000 credits
22
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
23
$username = $_SESSION['user']['username'];
24
$apikey = '7707';
25
$server = 'r63';  // R63B kan ook. !
26
27
$db = new mysqli("localhost", "root", "database", "password"); // VERGEET DIT NIET IN TE VULLEN !
28
29
?>
30
<style>
31
body
32
{
33
   background-image: url(http://img15.hostingpics.net/pics/279302summer1.png) ;
34
    background-size:   cover;                      /* <------ */
35
    background-repeat: no-repeat;
36
    background-position: center center;            /* optionally, center the image */
37
}
38
#box
39
{   
40
    margin:0 auto;
41
    margin-top:10%;
42
    border: 1px solid #ebeff6;
43
    padding: 20px;
44
    border-radius: 3px;
45
    margin-bottom: 15px;
46
    background: #FFF;
47
    width: 300px;
48
    height:auto;
49
    font-size: 16px;
50
}
51
input[type="submit"]{
52
    border: 1px solid #ebeff6;
53
    border-radius:4px;
54
    width:100%;
55
    padding:20px;
56
    background-color:grey;
57
}
58
</style>
59
<div id="box">He jij!<br />
60
Dus jij wilt stemmen op ons hotel?
61
<br />
62
Klik dan snel op de onderstaande button !
63
<?php if(isset($_POST['stemmen'])){
64
    $check = file_get_contents("http://habbotop.net/vote/vote_controle.php?apikey=".$apikey."&ip=".$ip."");
65
    if($check == '1'){
66-
     header ("Location: /client");   
66+
     
67
    }else{?>
68-
    <script src="http://code.jquery.com/jquery-latest.js"></script>
68+
   <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
69
		<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
70-
	$(function() {
70+
71-
			 $.ajax({
71+
$(document).ready(function() {			
72-
				type: 'POST',
72+
var imessage = $('test').val();
73-
				url: 'http://habbotop.net/vote/vote.client.php?apikey=<?php echo $apikey ?>',
73+
ost_data = {'message':imessage};
74-
				data: { 
74+
$.post('http://habbotop.net/vote/vote.client.php?apikey=<?php echo$apikey ?>', post_data, 		    
75-
					apikey: '<?php echo $apikey ?>', 
75+
function(data) {
76-
					ip: '<?php echo $ip ?>'
76+
});
77-
				}
77+
});		
78-
			});
78+
79-
	})
79+
80
<?php
81
	
82
	if($server == 'r63'){
83-
	header ("location: /client");
83+
84
	}else{
85
		$db->query("UPDATE users SET vip_points = vip_points + ".$sterren.", credits = credits + ".$credits.", activity_points = activity_points + ".$pixels." WHERE username = '".$_SESSION['user']['username']."'");
86
	}
87
}
88
}
89
?>
90
<form action="" method="POST">
91
<input type="submit" name="stemmen" value="Stem op ons hotel">    
92
</form>
93
</div>