Page 1 of 2

server sending two versions of code

Posted: Fri Nov 18, 2005 10:20 am
by sparky_hd
i'm so baffled. i have a piece of PHP code (in an open-source CMS called Joomla) that is just not appearing when i access it from a particular computer. The actual source code is missing a chunk when i view it from this particular computer. i thought that PHP (where no variables are involved) would output the same code to any browser just the same, so i'm confused. If it makes any difference, here's the code for the little module. Remember, the module is working fine at every computer but one. i tested it in IE and Firefox on all machines.

Code: Select all

<?php 
/**
* A FlashBanner module that is accessible with alternative image
* Designed For Mambo 4.5.3
* Mambo is Free Software
* This Module is released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* version $Revision: 1.0 $
* Date 09/30/2005
**/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

// parameters
//$moduleclass_sfx = $params->get( 'moduleclass_sfx' );
$bannerurl = $params->get( 'bannerurl');
$name = $params->get( 'name');
$bannerX = $params->get( 'bannerX');
$bannerY = $params->get( 'bannerY');
$bgcolor = $params->get( 'bgcolor');
$banneralturl = $params->get( 'banneralturl');
$altname = $params->get( 'altname');
$banneraltX = $params->get( 'banneraltX');
$banneraltY = $params->get( 'banneraltY');

echo "<object data=\"$bannerurl\" type=\"application/x-shockwave-flash\" codebase=\"$bannerurl\" width=\"$bannerX\" height=\"$bannerY\"><param name=\"movie\" value=\"$bannerurl\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"$bgcolor\" /><img src=\"$banneralturl\" width=\"$banneraltX\" height=\"$banneraltY\" alt=\"$altname\" /></object>";
?>

Posted: Fri Nov 18, 2005 10:33 am
by Jenk
check cache settings.

:)

Posted: Fri Nov 18, 2005 10:55 am
by sparky_hd
in the browser? we cleared the cache in IE a few times and the Firefox was on a clean install.

Posted: Fri Nov 18, 2005 11:08 am
by Jenk
Proxy cache?

Tried Ctrl+F5 (refresh from source)?

Posted: Fri Nov 18, 2005 11:37 am
by sparky_hd
At your suggestion, yes. But it still doesn't work.

Posted: Fri Nov 18, 2005 11:48 am
by hawleyjr
sparky_hd wrote:in the browser? we cleared the cache in IE a few times and the Firefox was on a clean install.
Firefox typically imports all IE data on load. Clean the cache in FF also :)

Posted: Fri Nov 18, 2005 11:57 am
by sparky_hd
OK we just tried that. Cleared cache, then cleared everything in FF. Same result. i'm so stumped. Thanks for the help so far!

Posted: Fri Nov 18, 2005 12:00 pm
by Charles256
re-install the OS?:-D

Posted: Fri Nov 18, 2005 12:17 pm
by sparky_hd
Don't tempt me....

Posted: Fri Nov 18, 2005 12:22 pm
by sparky_hd
Let me be dumb for a minute. Just to make sure i understand correctly, when you're using PHP, the server computes the HTML (based on the code) and sends it to the browser, right? So if that's the case, i don't see how it could be a browser/system issue, because when i query the page i should get fresh info every time, right? In what situations would the server all of the sudden say, "oh, it's THAT computer again. i think i'll just hide this piece of code"? i mean, there aren't any conditional statements in the module at all, and if there were somewhere else in the CMS, what kind of statement would give this result?

Posted: Fri Nov 18, 2005 12:30 pm
by yum-jelly
Is Flash installed on the computer browser, or are security settings set to allow objects?

yj

Posted: Fri Nov 18, 2005 12:36 pm
by sparky_hd
Good suggestion, but flash appears when viewing other pages. in addition to that, i believe the particular method in use (called the Flash Satay method) is designed to show an alternate image in case Flash isn't available, so i think at least that would show. But you have me curious- if there was a setting to disable objects, or certain types of objects, would it be stripped right out of the source code read by the browser?

Posted: Fri Nov 18, 2005 12:45 pm
by hawleyjr
Try this:

Code: Select all

//put this at the top of your page
  Header('Cache-Control: no-cache');
  Header('Pragma: no-cache');

Posted: Fri Nov 18, 2005 1:45 pm
by sparky_hd
Not that either. But now i'm on a new track. What yum-jelly said got me thinking. Is it possible that the browser simply omits some code for some security reason? i went ahead and make a plain HTML page that's an exact duplicate of the PHP's final output (from a machine that displayed it properly). When i viewed it on that particular machine, again it didn't show- not even in the source! i also included a some plain text in the echo before the object tag in the original PHP module. THAT showed up!

So evidentally this isn't a PHP issue at all. i think the reason i'm running into this problem now is the Flash Satay method- there must be some characteristic about it that causes some local setting to strip the object tag out of the html altogether. Maybe an anti-spam or internet tool? Should i close this and find a new forum now that we know it's not really a PHP issue?

Here's the final object tag rendered by the Satay method, in case anyone can spot a characteristic that would casue a machine to omit it.

Code: Select all

<object data="http://www.domain.com/movie.swf" type="application/x-shockwave-flash" codebase="http://www.domain.com/movie.swf" width="780" height="209">
 <param name="movie" value="http://www.domain.com/movie.swf" />
 <param name="menu" value="false" />
 <param name="quality" value="high" />
 <param name="bgcolor" value="white" />
 <img src="http://www.domain.com/alternateimage.jpg" width="780" height="209" alt="FlashBanner" />
</object>

Posted: Fri Nov 18, 2005 1:47 pm
by Charles256
i'm all for destroying that computer..not that that's likely to help much... :-D