-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcambiar-sexo.php
97 lines (77 loc) · 1.94 KB
/
cambiar-sexo.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
session_start();
error_reporting(0);
include_once('./css/index.php');
if(isset($_SESSION['User']))
{
$User = $_SESSION['User'];
$stmt = $con->prepare("SELECT * FROM usuarios WHERE Username = :usuario");
$stmt->bindParam(':usuario', $User, PDO::PARAM_STR);
$stmt->execute();
while($datos = $stmt->fetch())
{
$ID = $datos['ID'];
}
}
else echo "<script>window.location='ingresar.php';</script>";
$stm = $con->prepare("SELECT * FROM usuarios WHERE ID = :id");
$stm->bindParam(':id', $ID, PDO::PARAM_INT);
$stm->execute();
$num_rows = $stm->rowCount();
if($num_rows > 0)
{
while($dato = $stm->fetch())
{
$moneda = $dato['Moneda'];
$clavereal = $dato['Password'];
$sexo = $dato['Sexo'];
$clave = $_POST['ps'];
if($dato['Online'] == 1)
{
echo "4";
return 0;
}
if($dato['Moneda'] < 10)
{
echo "2";
return 0;
}
if(strcmp($clavereal, md5($clave)) !== 0)
{
echo "5";
return 0;
}
if($sexo == 1)
{
$st = $con->prepare("UPDATE usuarios SET Sexo = 2, Skin = 11, Moneda = :moneda-10 WHERE ID = :id");
$st->bindParam(':moneda', $moneda, PDO::PARAM_INT);
$st->bindParam(':id', $ID, PDO::PARAM_INT);
$st->execute();
echo "3";
return 0;
}
else
{
$st = $con->prepare("UPDATE usuarios SET Sexo = 1, Skin = 250, Moneda = :moneda-10 WHERE ID = :id");
$st->bindParam(':moneda', $moneda, PDO::PARAM_INT);
$st->bindParam(':id', $ID, PDO::PARAM_INT);
$st->execute();
echo "3";
return 0;
}
}
}
else
{
echo "1";
return 0;
}
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-104151474-1', 'auto');
ga('send', 'pageview');
</script>