Hello friends, How to write the code for playing videos dynamically, for example, my video file name is video.php?file.mpg how to retrieve the file.mpg from the url and play the video in the browser. I will be helpful to u. Thanks,
video.php?play=file.mpg <?php $videofolder = './videos/'; $filename = $_GET['play']; if (!preg_match('/\.(mpe?g|wmv|avi)$/i', $filename) OR !file_exists($videofolder . $filename)) { exit(); } ?> <embed src="<?php echo $videofolder . $filename; ?>" autostart="false" /> PHP: