Skip to content

Instantly share code, notes, and snippets.

@zelon88
Last active July 2, 2016 04:21
Show Gist options
  • Save zelon88/087222c9cc46f06386ca2025fbc9caa1 to your computer and use it in GitHub Desktop.
Save zelon88/087222c9cc46f06386ca2025fbc9caa1 to your computer and use it in GitHub Desktop.
Redirect users based on device or screen size
<!DOCTYPE html>
<title>Cloud Authentication</title>
<html lang="en-US">
<html>
<body>
<div align="center"><h1>Configuring your Cloud Drive ...</h1></div>
<div align="center"><img src="http://localhost/wp-content/uploads/2016/03/Cloud-Banner.png" alt="HonestRepair Cloud Storage"</div>
<div align="center"><img src="http://localhost/HRProprietary/pacman.gif" alt="PacMan is gathering information!" height="24" width="24"></div>
<div align="center"><strong>Please wait while we authenticate your account and adjust the Cloud to your device...</strong></div>
<?php // / Set the number of pixels a screen needs to be to see page . ?>
<script type="text/javascript">// < ![CDATA[
<?php // / Set the URL below to the page the user is sent to if their screensize is UNDER the specified number of pixels. ?>
if (screen.width <= 699) { document.location = "http://localhost/PAGE_0"; }
// ]]></script>
<?php // / Set the number of pixels a screen needs to be to see page 1. ?>
<script type="text/javascript">// < ![CDATA[
if (screen.width >= 700) {
<?php // / Set the URL below to the page the user is sent to if their screensize is OVER the specified number of pixels. ?>
document.location = "http://localhost/PAGE_1";
}
// ]]></script>
<script language=javascript>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("http://localhost/PAGE_FOR_IPODS");
}
-->
</script>
<script language=javascript>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i))) {
location.replace("http://localhost/PAGE_FOR_IPADS");
}
-->
</script>
<meta http-equiv="refresh" content="5"; url="http://localhost/PAGE_IF_NOTHING_HAPPENS_FOR_SOME_REASON" >
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment