Ninjakreborn Posted February 8, 2007 Share Posted February 8, 2007 I have a function that get's the extension of a file (it work's, it's been tested, it echo's out the extension when echod) however it's not working on the if-ifelse statement to test the extension against a variety of conditions. <h1>Audio/Video Viewing Section</h1> <?php $id = deepclean($_GET['id']); $select = "SELECT * FROM user_files WHERE id = '$id';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { $ext = getext($row['filename']); if ($ext == ".rm" || $ext = ".ram") { require_once($docroot . "/views/view_realmedia.php"); }elseif ($ext == ".mov") { require_once($docroot . "/views/viewwindowsmedia.php"); }elseif ($ext == ".wmv" || $ext == ".wma" || $ext == ".mp3") { require_once($docroot . "/views/view_quicktime.php"); }elseif ($ext == ".swf") { require_once($docroot . "/views/view_flash.php"); }else { echo "Match Not Found.<br />"; } } ?> That is pretty much all the relevant code, each include (triple checked) holds the information to embed a different type of player. It's suppose to (based on extension) send them to the right one. Right now, it's including the real player one, the file is wmv, I have it set to open quicktime, but it still keep's opening real player. Is something wrong with my conditional statement in some way. Quote Link to comment https://forums.phpfreaks.com/topic/37610-solved-reading-ext-not-working/ Share on other sites More sharing options...
Ninjakreborn Posted February 8, 2007 Author Share Posted February 8, 2007 Nevermind, one = was suppose to be == Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/37610-solved-reading-ext-not-working/#findComment-179844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.