Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
20 righe
1009 B
20 righe
1009 B
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"])) { |
|
if (isset($_GET["id"])) { |
|
$bind = [":codice_conference"=>$_GET["id"],":codice_utente"=>$_SESSION["utente"]->codice]; |
|
$bind[":ip"] = get_client_ip(); |
|
$check = $pdo->go("SELECT codice FROM r_ping WHERE codice_conference = :codice_conference AND codice_utente = :codice_utente AND ip = :ip AND last_ping >= NOW() - INTERVAL 1 MINUTE",$bind); |
|
if ($check->rowCount() > 0) { |
|
$codice = $check->fetch(PDO::FETCH_ASSOC)["codice"]; |
|
$bind = []; |
|
$bind[":codice"] = $codice; |
|
$bind[":ip"] = get_client_ip(); |
|
$pdo->go("UPDATE r_ping SET last_ping = CURRENT_TIMESTAMP(), ip = :ip WHERE codice = :codice",$bind); |
|
} else { |
|
$pdo->go("INSERT INTO r_ping (codice_conference,codice_utente,ip,first_ping) VALUES (:codice_conference,:codice_utente,:ip,CURRENT_TIMESTAMP())",$bind); |
|
} |
|
} |
|
} |
|
?>
|