/
out.php
57 lines (39 loc) · 1.5 KB
/
out.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
<?php
//ini_set('error_reporting', E_ALL);
ini_set('display_errors', FALSE);
date_default_timezone_set('America/New_York');
$UserID = 0;
$UserName = '';
$UserSort = 0;
$UserFlags = 0;
$SessionID = 0;
$SessionCoords = array();
$LanguageID = 0;
require_once './Code/Cookies.php';
require_once './Code/DB.php';
require_once './Code/Logging.php';
require_once './Code/Validator.php';
ReadCookies();
if (!empty($_GET)) {
if (is_array($_GET)) {
foreach ($_GET as $ID => $Value) {
if (is_numeric($ID)) {
OpenDB();
list ($QR, $DR, $T) = QuerySingle("SELECT D.DealURL, DS.DealSourceRefCode
FROM 4000_Deals D
INNER JOIN 4100_Deal_Sources DS ON DS.DealSourceID = D.DealSourceID
WHERE D.DealID = ".(int)$ID.";");
if ($QR > 0) {
if (!ExecCommand("INSERT INTO 4200_Deal_Clickthroughs (DealID, UserID, ClickDate) VALUES (".(int)$ID.",".$UserID.",".date('YmdHis').");"))
SysLogIt('Error inserting clickthrough data.', StatusError, ActionInsert);
header('Location: '.$DR['DealURL'].$DR['DealSourceRefCode']);
exit();
}
CloseDB();
break;
}
}
}
}
header('Location: /index.php');
?>