-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch.php
More file actions
executable file
·34 lines (28 loc) · 865 Bytes
/
fetch.php
File metadata and controls
executable file
·34 lines (28 loc) · 865 Bytes
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
<?php
include "customfunctionlibrary.php";
$uid1 = ltrim($_SERVER['REQUEST_URI'], '/');
//Strange bug with ltrim where it removes extra ts from the beginning of the string
//$uid = ltrim($uid1, "Multi-URL/");
$uid = str_replace("Multi-URL/","",$uid1);
$dbserver = getenv('MYSQL_SERVER_MULTIURL');
$dbusername = getenv('MYSQL_USER_MULTIURL');
$dbpassword = getenv('MYSQL_PASSWORD_MULTIURL');
$dbname = getenv('MYSQL_DB_MULTIURL');
$dbport = getenv('MYSQL_PORT_MULTIURL');
$dbaccess = true;
$results = get_arr_from_db('title,urls',$uid,'shortlink','multiurl');
if ($results == 'No results'){
header("Location: https://multiurl.sftg.io/404.html#".$uid);
die();
}
else{
if ($dbaccess == false){
echo $results;
}
else{
$title = $results[0][0];
$links = json_decode($results[0][1],true);
include 'render.php';
}
}
?>