forked from kiranvj/GetSpriteXY.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotify-ajax-example.php
More file actions
43 lines (37 loc) · 1.16 KB
/
notify-ajax-example.php
File metadata and controls
43 lines (37 loc) · 1.16 KB
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
ob_start();
error_reporting(0);
require_once("generic-functions.php");
$ip=$_SERVER['REMOTE_ADDR'];
$env = "prod"; //local or prod
if($env == "local") {
$db = "spritexy";
$user = "root";
$password = "";
} else {
$db = "";
$user = "";
$password = "";
}
if ($_POST) {
$isSpriteCreated = isset($_POST["isSpriteCreated"]) && $_POST["isSpriteCreated"] != "" ? htmlentities($_POST["isSpriteCreated"], ENT_QUOTES) : false;
$con = mysql_connect('localhost', $user, $password);
if (!$con) {
die('An error occured ERR:1');
} else {
mysql_select_db($db,$con) or die("Ooopss.... An error occured. ERR:2");
$item = $isSpriteCreated == "true" ? "css_generate" : "sprite_upload";
$query = "UPDATE stat SET counter = counter + 1 WHERE item = '$item'";
$result = mysql_query($query,$con);
if($result) {
echo("{\"e\":\"0\"}");
} else {
echo("{\"e\":\"1\"}");
}
}
}
else {
echo("I sincerely appreciate your efforts... but M3SS w1t|-| 7he b3s7 |)13 |ik3 7h3 r3s7");
notifyAdminViaMail("$ip - HACK ATTEMPT", "hack attempt");
}
?>