...

View Full Version : Open Flash File for current page



oldtimeyjunk
11-10-2011, 05:55 PM
I've been searching and searching and trying out different things, but I cannot find/get anything to work!

Basically, what I need is for when the user visits, say, "www.mypage.net/flashpage.php?=blah", the Flash object HTML "<object ..." will make the file "www.mypage.net/files/blah.swf" be the Flash file.

I've seen this done before... I just have no idea how to do it!

Could someone point me in the right direction... :rolleyes:

mlseim
11-10-2011, 07:43 PM
Example URL:
www.mypage.net/flashpage.php?file=blah



<?php

// set a default in case they enter without a file specified
$file="noshow.swf";

// if they entered a file, use it.
if($_GET['file']){
$file=$_GET['file'].".swf";
}

// now, you should make sure the file exists.
$check="www.mypage.net/files/$file";
if(file_exists($check)){
// it's OK
}
else{
// it does not exist, so use the default.
$file="noshow.swf";
}

// now you continue on with your page ...
// you'll use the $file variable later on, in your HTML.
?>

<html>
<body>
blah blah blah
<object ... stuff stuff src="www.mypage.net/files/<?=$file?>" ... stuff stuff>
</object>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum