Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/patientapps_beta/ |
Upload File : |
<?php
// https://go.patientapps.net/hrx
// http://go.patientapps.net/ma2-rcl
/*
CREATE TABLE IF NOT EXISTS `shortlink_click` (
`starthour` int(11) NOT NULL,
`window` int(11) NOT NULL,
`ip_address` varchar(32) NOT NULL,
`count` int(11) NOT NULL,
`shortcode` varchar(10) NOT NULL,
PRIMARY KEY (`shortcode`,`starthour`,`ip_address`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='QRCode impressions';
*/
require_once __DIR__ . '/include/include.php';
$x = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
if (($p = strpos($x, '?')) !== FALSE) {
$x = substr($x, 0, $p);
}
$x = substr($x, 1);
$data = $db->Lookup('select sl_full from shortlink where sl_short=%s', $x);
if ($data['__existing']) { // found short code
header('Content-type: text/plain');
// group hits by ipaddress/hour
$hour = intval(time() / 3600);
$starttime = $hour * 3600;
$ipaddress = getClientIP();
$click = $db->Lookup('select * from shortlink_click where shortcode=%s and starthour=%d and ip_address=%s', [$x, $hour, $ipaddress], 'shortlink_click');
if (!$click['__existing']) {
$click['shortcode'] = $x;
$click['starthour'] = $hour;
$click['window'] = $starttime;
$click['ip_address'] = $ipaddress;
$click['count'] = 0;
}
$click['count']++;
$db->SaveRecord($click);
// update counter
$db->Query('update shortlink set sl_count=sl_count + 1 where sl_short=%s', $x, '', NULL);
// show preview ??
$link = $data['sl_full'];
header("Location: $link");
exit;
}
$e = explode('/', trim($x, '/'));
if (count($e) > 1 && $e[0] == 'external') {
$controller = str_replace('..', '', $e[1]);
$filename = __DIR__ . '/api/.api/' . $controller . '.php';
if (file_exists($filename)) {
try {
require_once $filename;
} catch (Throwable $e) { // php 7
die('Error:' . $e->getMessage() . ' in ' . $e->getFile() . ' at line ' . $e->getLine() . ' [7]');
}
exit;
}
}
header('Location: https://patientappsinc.com/');