Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: open

Message Too Old, No Replies

How to check if a .swf exists

error checking

     
12:37 am on Jun 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 6, 2008
posts:2011
votes: 0


I pass a GET variable to call my swf's with php. If a .swf doesn't exist, is there anyway I can know this and redirect to an error page or display an error message instead of a blank box where a flash file should be?
1:46 am on June 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


var $flash = '/full/path/to/swf/dir/' . $_GET['f']; // Cleanse!

if (is_file($flash)) { // display it }
else { // alt content }

Something like that?

3:17 am on June 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 6, 2008
posts:2011
votes: 0


That worked perfectly! Thank you.