Are there alternative methods, besides PHP, to redirect users who cannot view Flash movies to a different page variant?
When users cannot view Flash movies, it is important to redirect them to a different page variant that does not rely on Flash content. One alternative method to achieve this is by using JavaScript to detect if the browser supports Flash, and if not, redirect the user to a different page.
<?php
if (isset($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
echo '<script>window.location.replace("alternative_page.php");</script>';
}
?>
Keywords
Related Questions
- How can the use of clearstatcache() in PHP help address delays in recognizing file changes on the server?
- How can PHP developers avoid the issue of binding parameters that do not exist in the query when using PDO?
- What are best practices for securing .htaccess files in a PHP environment to prevent unauthorized access or modifications?