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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.