-
Notifications
You must be signed in to change notification settings - Fork 0
/
again.php
43 lines (38 loc) · 1.52 KB
/
again.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
38
39
40
41
42
43
<?php
if((isset($_COOKIE['thecry']))){
require 'static/php/system/database.php';
require 'static/php/system/config.php';
$conexao = mysql_pconnect($hostp,$userp,$passwrdp) or die (mysql_error());
$banco = mysql_select_db($dbp);
$senha=$_POST['senha'];
$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
$idcry = DBEscape( strip_tags(trim($_COOKIE['thecry']) ) );
$usercry = DBRead('user', "WHERE thecry = '{$idcry}' LIMIT 1 ");
$usercry = $usercry[0];
$iduser1 = $usercry['id'];
$emailuser =$usercry['email'];
$sql="select * from pixel_user where senha= '".sha1($senha)."'";
$resultados = mysql_query($sql)or die (mysql_error());
$res=mysql_fetch_array($resultados);
if (@mysql_num_rows($resultados) == 0){
print "<p>Senha incorreta!</p>"; exit();
}
$user = DBRead('user', "WHERE email = '{$email}' LIMIT 1 ");
$user = $user[0];
$user = DBRead('user', "WHERE id = '{$iduser1}' LIMIT 1 ");
$user = $user[0];
$inisession = date('Y-m-d H:i:s');
$busca = "SELECT id FROM pixel_user WHERE email = '".$emailuser."'";
$identificacao = mysql_query($busca);
$retorno = mysql_fetch_array($identificacao);
$iduser = $retorno['id'];
$userUP['lastlogin'] = date('Y-m-d H:i:s');
setcookie("iduser", $iduser, time()+3600 * 24 * 365);
setcookie("inisession", $inisession, time()+3600 * 24 * 365);
if( DBUpdate( 'user', $userUP, "id = '{$iduser}'" ) ){
echo '';
}
echo '<script>location.href="/";</script>';
exit;
}
?>