C:\xampp\htdocs\kptv\ajax\up_voteplus_new.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once("../admin/dbconn.php");
require_once 
"../ro/func/vote.php";

$ip $_SERVER['REMOTE_ADDR'];
$datenow date("Y-m-d");
$type_of_song $_POST['type_of_song'];

if (
$_POST['id']) {
    
$id $_POST['id'];
    
$id mysql_real_escape_string($id);

    
$ip_sql mysql_query("SELECT ip FROM voteplus WHERE ip='$ip' AND datum='$datenow' AND type_of_song='$type_of_song'");
    
$count mysql_num_rows($ip_sql);

    if (
$count 2) {
        
$sql "UPDATE top20 SET up=up+1 WHERE id='$id' AND type_of_list='$type_of_song'";
        
mysql_query($sql);

        
$sql_in "INSERT INTO voteplus (song_id,ip,datum,type_of_song) VALUES ('$id','$ip','$datenow','$type_of_song')";
        
mysql_query($sql_in);
    }

    
$result mysql_query("SELECT up FROM top20 WHERE id='$id' AND type_of_list='$type_of_song'");
    
$row mysql_fetch_array($result);
    
$up_value $row['up'];

    
$ret_array = array(
        
'message' => 'VOTAT',
        
'symb' => Vote::getThisCurrentVoteSymbol($up_value)
    );

    echo 
json_encode($ret_array);
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586