-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirect.php
41 lines (40 loc) · 1.04 KB
/
redirect.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
32
33
34
35
36
37
38
39
40
41
<?php
$url = $_POST['url'];
if(isset($url))
{
if(str_contains(parse_url($url, PHP_URL_HOST), 'rajce.idnes.cz') && parse_url($url, PHP_URL_HOST) != 'rajce.idnes.cz')
{
if(parse_url($url, PHP_URL_PATH) === '/')
{
header("location: /profile.php?url=$url&page=0");
}
else
{
if(parse_url($url, PHP_URL_PATH) == '')
{
header("location: /profile.php?url=$url&page=0");
}
else
{
header("location: /album.php?url=$url");
}
}
}
else
{
include "includes/header.php";
echo '
<div class="alert alert-danger position-absolute top-50 start-50 translate-middle text-center" role="alert">
Byla zadána nesprávná adresa URL!<br>
<div class="pt-3">
<a href="../" class="btn btn-danger">Domovská stránka</a>
</div>
</div>
';
}
}
else
{
header("location: /");
}
?>