server sending two versions of code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

server sending two versions of code

Post 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>";
?>
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

check cache settings.

:)
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post by sparky_hd »

in the browser? we cleared the cache in IE a few times and the Firefox was on a clean install.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Proxy cache?

Tried Ctrl+F5 (refresh from source)?
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post by sparky_hd »

At your suggestion, yes. But it still doesn't work.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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 :)
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post 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!
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

re-install the OS?:-D
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post by sparky_hd »

Don't tempt me....
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post 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?
yum-jelly
Forum Commoner
Posts: 98
Joined: Sat Oct 29, 2005 9:16 pm

Post by yum-jelly »

Is Flash installed on the computer browser, or are security settings set to allow objects?

yj
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post 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?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Try this:

Code: Select all

//put this at the top of your page
  Header('Cache-Control: no-cache');
  Header('Pragma: no-cache');
sparky_hd
Forum Newbie
Posts: 9
Joined: Fri Nov 18, 2005 10:02 am

Post 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>
Last edited by sparky_hd on Fri Nov 18, 2005 1:48 pm, edited 2 times in total.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

i'm all for destroying that computer..not that that's likely to help much... :-D
Post Reply