-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredirect.php
71 lines (51 loc) · 1.28 KB
/
redirect.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SteamDotGroup | redirecting...</title>
<?php
// Required files
require 'utils.php';
require './log/logger.php';
// Set steam group base url
$sg_base_url = "https://steamcommunity.com/groups/";
// Declare request (eg. /home/index.php)
$request = $_SERVER['REQUEST_URI'];
// Set arguments
$args = explode('/', $request);
$option = "redirect";
// Set steamgroup name
$sg = $args[1];
if ($sg == null) {
// No steamgroup given => Error
error('No steamgroup set!');
die();
}
// Check for options
if (count($args) > 2) {
$option = $args[2];
}
analytics($sg);
// Set full steamgroup URL
$sg_url = $sg_base_url . $sg;
$sg_url = htmlspecialchars($sg_url);
?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-105814613-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-105814613-5');
</script>
</head>
<body>
</body>
</html>
<?php
// Redirect to steam group
header("Location: $sg_url");
die();
?>