Factor out short url in dedicated var
This commit is contained in:
parent
c9906be861
commit
059ade3de9
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue