-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsive.php
38 lines (38 loc) · 1.49 KB
/
responsive.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
<html style='display: none';></html>
<?php
include 'admin/database/system_detail.php';
session_start();
if (isset($_SESSION['screen_width']) and isset($_SESSION['screen_height'])) {
if(isset($_GET["lokasi"])){
echo "<script>window.location='lokasi.php';</script>";
}else if(isset($_GET["profil"])){
echo "<script>window.location='profil.php';</script>";
}else{
echo "<script>window.location='index.php';</script>";
}
} else if (isset($_GET['width']) and isset($_GET['height'])) {
$_SESSION['screen_width'] = $_GET['width'];
$_SESSION['screen_height'] = $_GET['height'];
$x = $_SERVER["REQUEST_URI"];
$parsed = parse_url($x);
$query = $parsed['query'];
parse_str($query, $params);
unset($params['width']);
unset($params['height']);
$string = http_build_query($params);
$domain = $_SERVER['PHP_SELF'] . "?" . $string;
header('Location: ' . $domain);
} else {
$x = $_SERVER["REQUEST_URI"];
$parsed = parse_url($x);
$query = $parsed['query'];
parse_str($query, $params);
unset($params['width']);
unset($params['height']);
$string = http_build_query($params);
$domain = $_SERVER['PHP_SELF'] . "?" . $string;
echo '<script type="text/javascript">window.location = "' . $domain . '&width="+screen.width+"&height="+screen.height;</script>';
}
echo "<script>setTimeout(function(){ window.location.href = 'index.php'; }, 250);</script>";
?>
<script>document.getElementById(html).style.display = 'none';</script>