Last active
January 23, 2025 20:04
-
-
Save UVLabs/b39fa648e51bf3d71162 to your computer and use it in GitHub Desktop.
Media Queries in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_GET['width'])) { | |
$width = $_GET['width']; | |
if ($width <= 480) {include ('mobile_file.php');} //mobile devices | |
} else { | |
echo "<script language='javascript'>\n"; | |
echo " location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}" . "&width=\" + screen.width; \n"; | |
echo "</script>\n"; | |
exit(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment