Factor out short url in dedicated var

This commit is contained in:
Simon Lieb 2017-02-07 13:07:39 +01:00
parent fbc64fb8bf
commit 63351e4b50

View file

@ -25,7 +25,10 @@ if (!empty($_GET['url'])) {
mkdir($hashfolderpath, 0700, true); mkdir($hashfolderpath, 0700, true);
file_put_contents($hashfilepath, $url); file_put_contents($hashfilepath, $url);
$content = '<a href="./?'.$urlhash.'">http://'.$_SERVER['HTTP_HOST'].'/?'.$urlhash.'</a>';
$shortUrl = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['SCRIPT_NAME'].'?'.$urlhash;
$content = '<a href="'.$shortUrl.'">'.$shortUrl.'</a>';
} elseif (!empty($_GET)) { } elseif (!empty($_GET)) {
$urlhash = key($_GET); $urlhash = key($_GET);