Jump to content

[SOLVED] Reading ext not working


Ninjakreborn

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/37610-solved-reading-ext-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.