-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
31 lines (29 loc) · 1.46 KB
/
index.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
<?php
include("sys/func.php");
if(verifyLinkKey($_GET['v'])) {
$id = intval($_GET['v'],36);
include('mysql_connect.php');
mysql_query("INSERT INTO link_visit (link_id,user_agent,ip,timestamp) VALUES ('".$id."','".addslashes($_SERVER['HTTP_USER_AGENT'])."','".addslashes($_SERVER['REMOTE_ADDR'])."','".date("Y-m-d H:i:s")."')") or die(mysql_error());
$url = mysql_query("SELECT * FROM link WHERE id='".intval($_GET[v],36)."'") or die(mysql_error());
$url = mysql_fetch_assoc($url) or die(mysql_error());
if(!isset($url['href']) || $url['href'] == "") $url['href'] = "index.php";
include_once "lib/Pubnub.php";
$pubnub = new Pubnub("pub-80743985-ff70-4d32-969c-d68b7e92b2d9","sub-9e516238-2685-11e1-b204-671e781827dd");
$pubnub->publish(array(
'channel' => trim($_GET['v']),
'message' => array('ip' => $_SERVER['REMOTE_ADDR'], 'browser' => getBrowserFromUserAgent($_SERVER['HTTP_USER_AGENT']), 'os' => getOSFromUserAgent($_SERVER['HTTP_USER_AGENT']))
));
header('Location: '.$url['href']);
}
else if(isset($_GET['v'])) {
header("Location: !e404");
}
else {
if(!isset($_GET['s'])) $_GET['s'] = 'create';
if(file_exists("sys/".trim($_GET['s']).".php")) include_once "sys/".trim($_GET['s']).".php";
else {
$page_content = '<span class="red">Failure!</span> Module requested does not exist ('.trim($_GET['s'].')');
$page_title = 'Error: Module not found';
}
include_once "style/layout.php";
} ?>