-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
48 lines (43 loc) · 903 Bytes
/
index.php
File metadata and controls
48 lines (43 loc) · 903 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SFCOFFEE</title>
<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
$browser = 'desktop';
if (preg_match("/android/i", $agent))
{
$browser = 'android';
}
elseif (preg_match("/Trident/i", $agent))
{
$browser = 'ie';
}
elseif (preg_match("/iP(hone|od|ad)/i", $agent))
{
$browser = 'ios';
}
switch ($browser) {
case 'ie':
echo '<script> window.location = "/sfcoffee/blogs/"</script>';
break;
case 'android':
echo '<script> window.location = "/sfcoffee/blogs/"</script>';
break;
case 'ios':
echo '<script> window.location = "/sfcoffee/blogs/"</script>';
break;
default:
echo '<script> window.location = "/sfcoffee/blogs/1/"</script>';
}
?>
</head>
<body>
<nav>
<h1 id='mainTitle'>Coffee Shops of San Francisco</h1>
</nav>
<article id='main'>
</article>
</body>
</html>