-
Notifications
You must be signed in to change notification settings - Fork 0
/
verificando.php
37 lines (34 loc) · 1.21 KB
/
verificando.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
36
37
<?php
require 'static/php/system/database.php';
require 'static/php/system/config.php';
if(isset($_COOKIE['iduser']) ){
$conexao = mysql_pconnect($hostp,$userp,$passwrdp) or die (mysql_error());
$banco = mysql_select_db($dbp);
$pincode= $_POST['pincode'];
$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$user = DBRead('user', "WHERE id = '{$iduser}' LIMIT 1 ");
$user = $user[0];
if($user['pin'] == $pincode){
echo '<p>Redirecionando</p>';
$inisession = date('Y-m-d H:i:s');
$iduser = $iduser;
$userUP['lastlogin'] = date('Y-m-d H:i:s');
$userUP['ip'] = $ip;
setcookie("inisession", $inisession, time()+3600 * 24 * 365);
$busca2 = "SELECT thecry FROM pixel_user WHERE id = '".$iduser."'";
$identificacao2 = mysql_query($busca2);
$retorno2 = mysql_fetch_array($identificacao2);
$idcry = $retorno2['thecry'];
setcookie("thecry", $idcry, time()+3600 * 24 * 365);
if( DBUpdate( 'user', $userUP, "id = '{$iduser}'" ) ){
echo '';
}
echo '<script>location.href="/";</script>';
exit;
}
else{
echo '<p>Pincode incorreto</p>';
}
}
?>