Check for valid filename

CODE (No Display)

<?php
//strstr will search the video name for any spaces that will keep the video from displaying properly or the file extension if it is not flv
$space = strstr($videoname, " ");
$flv = strstr($videoname, ".flv");
if($space !== false)// note: three equal signs
{
header('Location: videoselect.php?return=1&display='.$display);
}
elseif($videoname =='')
{
header('Location: videoselect.php?return=2&display='.$display);
}
elseif($flv === false)// note: three equal signs
{
header('Location: videoselect.php?return=3&display='.$display);
}
else
{
header('Location: videoselect_confirmed.php?display='.$display);
}
?>