I want to create a script that will display video if the file format of file uploaded by user is video file or image if the file format is image file, I don't have problem with the query and the extension function, but I'm having problem with displaying the result of the image and playing the video, below is the code
<?php
$file = $row1['file'];
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == 'mp4' || $ext == 'mov' || $ext == 'vob' || $ext == 'mpeg' || $ext == '3gp' || $ext == 'avi' || $ext == 'wmv' || $ext == 'mov' || $ext == 'amv' || $ext == 'svi' || $ext == 'flv' || $ext == 'mkv' || $ext == 'webm' || $ext == 'gif' || $ext == 'asf') {
echo"<div class='flowplayer' data-swf='flowplayer.swf' data-ratio='0.4167'>";
echo "<video>";
echo'<source type="video/webm" src="https://edge.flowplayer.org/bauhaus.webm" autoplay="autoplay">';
echo"<source type='video/mp4" src="https://edge.flowplayer.org/bauhaus.mp4" autoplay="autoplay">';
echo "</video>";
echo"</div>";
}else{
echo'<img src="<?php echo GW_UPLOADPATH.$row1['file']; ?>" class="img-polaroid" alt="Img" width="550px" height="500px">';
}
?>
` is not correct, maybe you should check it before posting. Also, try being consistent with `"` and `'`.
– Casper Spruit Mar 22 '17 at 08:43