homepage Welcome to WebmasterWorld Guest from 54.205.160.82
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
Flashvars not working through PHP in FireFox
kitaabghar




msg:4090459
 7:25 am on Mar 3, 2010 (gmt 0)

Hi!

My problem is related to FireFox. What I am doing is working in IE but not in FF. Let me describe the details:

I am facing a problem in displaying images by using FLASHVARS to a SWF file through PHP script. When I pass the simple image URI to SWF, it works in IE as well as FF but when I pass the image URI through PHP, This works only in IE but not in FF.

The PHP Script I want to use is to hide the URI of the image and to avoid hotlinking of my images to save bandwidth. The PHP Script is famous CHImageGuard Script. For Ready Reference, it is also reproduced here at 3rd position.

I built a page that shows both the working and non-working examples, if you open it in IE it will display 2 images. If you open it in FF, it will only display image1.gif:

Following are the html codes I am using:

The code that works in both IE & FF.
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=""http://macromedia.com/cabs/swflash.cab#version=9,0,0,0""
WIDTH="500" HEIGHT="300" id="swfir.swf">
<PARAM NAME=movie VALUE="swfir.swf">
<PARAM NAME=FlashVars VALUE="url=image1.gif">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<embed src="swfir.swf" FlashVars="url=image1.gif"
quality="high" bgcolor="#FFFFFF" WIDTH="500" HEIGHT="300"
NAME="swfir" ALIGN TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</OBJECT>


The code that works only in IE but not in FF
The FF keeps showing "Transferring data from kitaabghar.com" in StatusBar :(

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=""http://macromedia.com/cabs/swflash.cab#version=9,0,0,0""
WIDTH="500" HEIGHT="300" id="php hanlder">
<PARAM NAME=movie VALUE="swfir.swf">
<PARAM NAME=FlashVars VALUE="url=displayimg.php%3Fimage%3Dimage2.gif">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<embed src="swfir.swf" FlashVars="url=displayimg.php%3Fimage%3Dimage2.gif"
quality="high" bgcolor="#FFFFFF" WIDTH="500" HEIGHT="300"
NAME="swfir" ALIGN TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</OBJECT>


The PHP Image Guard Script
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
/*

CHImageGuard (PHP version) 1.01
Copyright 2000-2003 by Christopher Heng. All rights reserved.

Visit http://www.example.com/ for the latest version
of this script. You can also contact me through the online
form on the website.


I. LICENCE TERMS

1. You may use this script on your website, with or
without modifications, free of charge.

2. You may NOT redistribute this script, whether modified
or not. The script is meant for your personal use on your
website, and can only be distributed by the author,
Christopher Heng.

3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
IMPLIED WARRANTY OF MECHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND
LIABILITIES ARISING FROM THE USE OF THE SCRIPT,
ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE
SCRIPTS AND THE DOCUMENTATION.

If you cannot agree to any of the above conditions, you
may not use the script.

Although it is NOT required, I would be most grateful
if you could also link to us at:

http://www.example.com/


II. INSTALLATION AND CONFIGURATION INSTRUCTIONS

Instructions for installing and configuring the
script can be found at:

http://www.example.com/

Look for the article "How to Protect Your Images
from Bandwidth Thieves".


III. SUPPORT

There is none. You got it without paying a cent, remember?

If you beg very politely, I may answer :-) - but there's no
guarantee of that. Officially, there's no support. You're
better off trying to read the article and following its
instructions. It's much faster.


IV. CONTACTING THE AUTHOR (BUG REPORTS, LICENSING QUESTIONS)

Please use the feedback form on the website:

http://www.example.com/feedback.php


V. WANT MORE SCRIPTS AND OTHER USEFUL WEBMASTER INFORMATION?

Sign up for the newsletter. It's free. To
subscribe, send an email (blank or otherwise) to:
subscribe@example.com
Or use the online form at:
http://www.example.com/

Note that the above email address is attached to a
mailing list program, which will process your subscription
request automatically. Do not send any email to me there -
there are no humans at that email address and your message
will not reach me. Use the feedback form at the site instead.

*/

// ---------------- CONFIGURABLE SECTION -----------------

// Please modify the following or it will not work on
// your website.

// Where did you actually put your images?
// Make sure that the path you put below ends with
// a directory slash ("/"). The script below assumes it.
$imagedir = "/home4/kitaabgh/public_html/images/" ;

// What are the websites (hostnames) that can use this
// image?
// If your site can be accessed with or without the
// "www" prefix, make sure you put both here. Do not put
// any trailing slashes ("/") nor any "http://" prefixes.
// Follow the example below.
$validprefixes = array (
"example.com",
"www.example.com"
) ;

// What is the main page of your website? Visitors will
// be directed here if they type
// "http://www.example.com/chimage.php"
// in their browser.
$homepage = "http://example.com/dir/" ;

// What is your email address?
// If you want to be informed when someone tries to use
// this script to access an image illegitimately, you
// must uncomment (remove the "//" prefix) the following
// line and change it to point to your email address.
//$email = "yourname@example.net" ;

// ------------ END OF CONFIGURABLE SECTION ------------


// --- YOU NEED NOT MODIFY ANYTHING AFTER THIS LINE ---

function isreferrerokay ( $referrer, $validprefixes )
{
$validreferrer = 0 ;
$authreferrer = current( $validprefixes );
while ($authreferrer) {
if (eregi( "^https?://$authreferrer/", $referrer )) {
$validreferrer = 1 ;
break ;
}
$authreferrer = next( $validprefixes );
}
return $validreferrer ;
}

//----------------------- main program -----------------------

$image = $_GET['image'] ;
$referrer = getenv( "HTTP_REFERER" );

if (isset($_GET['image'])) {

if (isreferrerokay( $referrer, $validprefixes )) {

$imagepath = $imagedir . $image ;

$imageinfo = getimagesize( $imagepath );
if ($imageinfo[2] == 1) {
$imagetype = "gif" ;
}
elseif ($imageinfo[2] == 2) {
$imagetype = "jpeg" ;
}
elseif ($imageinfo[2] == 3) {
$imagetype = "png" ;
}
else {
header( "HTTP/1.0 404 Not Found" );
exit ;
}

header( "Content-type: image/$imagetype" );
@readfile( $imagepath );

}
else {

if (isset($email)) {
mail( $email, "Bandwidth Theft Alert",
"WARNING:\n\n$referrer\ntried to access\n$image\n",
"From: CHImageGuard <$email>" );
}
header( "Location: $homepage" );
}
}
else {
header( "Location: $homepage" );
}

?>

[edited by: tedster at 5:34 pm (utc) on Mar 3, 2010]
[edit reason] no links, please [/edit]

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved