How can PHP be used to redirect users to a separate window to display a video?
To redirect users to a separate window to display a video using PHP, you can use the header() function to send a Location header with the URL of the video file. This will prompt the browser to open a new window or tab and play the video.
<?php
$videoUrl = "https://www.example.com/video.mp4";
header("Location: $videoUrl");
exit;
?>
Keywords
Related Questions
- How can PHP sessions be used to store not only user login status but also user roles for access control?
- What are the best practices for validating and sanitizing user input in PHP forums to prevent XSS attacks?
- How can PHP_SELF be effectively used in form actions to ensure proper form submission and data validation?