Forum Moderators: open
i am trying to force IE to get the latest version of a page.
i have streaming audio that plays on load, then when you click an image within a form the audio changes (well in firefox at least :) )
the only way i can get it to work in IE is to set the Internet Options to force new page on every visit,
is there another way, otherwise all IE clients will not get effect of this marketing tool unless they go to the trouble of changing internet options.
i have tried this so far: (this eg plays same audio for each image)
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
<!-- // -- // -->
<!-- webaudio content follows -->
<iframe src="http://www.example.com.au/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1" name="audio_frame" id="audio_frame" frameborder="0" width="1" height="1" scrolling="no" style="background-color:#000000;"></iframe>
<!-- end webaudio content -->
<!-- // --
<form action="http://www.example.com.au/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1" method="post" name="media_form" target="audio_frame">
<p align="center">
<input name="" type="image" src="images_1.png">
</p>
<p align="center">
<input name="" type="image" src="images_2.png">
</p>
<p align="center">
<input name="" type="image" src="images_3.png">
</p>
</form>
</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>
any help would be greatly appreciated
g00fy
[edited by: tedster at 7:25 am (utc) on Sep. 10, 2005]
[edited by: encyclo at 7:07 pm (utc) on Sep. 11, 2005]
[edit reason] Use example.com and fix sideways scroll [/edit]
I see you're using PHP - you can add HTTP headers to ensure that the page is never cached at the top of your page like this:
<?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
?> This should make IE refresh from the server each time.
Reference: PHP header function [ca.php.net]
/music.midi?rubbish=13476325463265483245
It will not affect your file, but the browser will think it's a new file and will load a fresh copy every time. You can use some rand() function to get the random stuff in there or md5() on user's IP address and current time or something like that.
lets hope IE7 offers as much to the programmers as it does to the public, current beta isnt looking like it :(
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test Audio</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
<!-- // ------------------------------------------------------------------------- // -->
<!-- webaudio content follows -->
<iframe src="http://www.example.com/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1&refresh=<?= microtime()*1000000?>" name="audio_frame" id="audio_frame" frameborder="0" width="1" height="1" scrolling="no" style="background-color:#000000;"></iframe>
<!-- end webaudio content -->
<!-- // ------------------------------------------------------------------------- // -->
<p align="center">
<a href="http://www.example.com/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1&refresh=<?= microtime()*1000000?>" target="audio_frame" >
<img src="images_1.png" border="0" />
</a>
</p>
<p align="center">
<a href="http://www.example.com/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1&refresh=<?= microtime()*1000000?>" target="audio_frame" >
<img src="images_2.png" border="0" />
</a>
</p>
<p align="center">
<a href="http://www.example.com/webaudio/play_media.php?mid= 746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1&refresh=<?= microtime()*1000000?>" target="audio_frame" >
<img src="images_3.png" border="0" />
</a>
</p>
</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>
[edited by: tedster at 3:48 am (utc) on Sep. 11, 2005]
[edited by: encyclo at 7:08 pm (utc) on Sep. 11, 2005]
[edit reason] use example.com in code - not real url [/edit]
100 lines of random numbers
You don't need that much. About 20-30 characters should be sufficient. The best way imho is to use md5() on user IP + current time + cpu cycles
this idea is to be retorofitted onto existing sites that may or may not be using a server language.
you can use javascript (client side) to generate random numbers
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); This also will only work if you have PHP (server side) installed.
100 lines goes to the fact that the page is being cached, my next attempt was as suggested and shows that each href has a unique refresh attribute on it and its still not working in IE
it seems that its may not be a cache problem though as the php header has no effect.
if i could post url's here i could show you the problem in IE that works in FF :(
kind regards,
g00fy
<?php header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$mediaFile = $_GET['mid'];
$backColor = $_GET['bc'];
$width = $_GET['w'];
$height = $_GET['h'];
$autoplay = $_GET['ap'];
$autoplay = $autoplay == "1"? "true" : "false";
//echo 'height: ' . $height . ' width: ' .$width . "<br />" .
// 'backColor: ' . $backColor . ' mediaFile: ' . $mediaFile;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Web Audio Player</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
<body bgcolor="#<?= $backColor?>">
<div style="position: absolute; top: 0px; left: 0px;" id="flashPlayer">
<OBJECT id="intro"
codeBase="http://www.example.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
height="21" width="63" align="texttop"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT>
<PARAM NAME="Movie" VALUE="http://www.example.com/webaudio/player.swf?mid=<?= $mediaFile?>&ap=<?= $autoplay?>">
<PARAM NAME="WMode" VALUE="transparent">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="BGColor" VALUE="#<?= $backColor?>">
<embed src="http://www.example.com/webaudio/player.swf?mid=<?= $mediaFile?>&ap=<?= $autoplay?>"
width="63" height="21" align="middle" wMode="transparent"
pluginspace="http://www.example.com/go/getflashplayer">
</embed>
</OBJECT>
</div>
</body>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>
[edited by: g00fy_m at 4:24 am (utc) on Sep. 11, 2005]
as for the IFRAME, i changed the link from one of the images that would normally target the IFRAME. so when u click image it goes straight to that page, still no good in IE :(
also if i refresh the page with that holds IFRAME i get nothing, IE will only play the first audio stream and that is it again :(, yet both URL's are the same except for the refresh attrib
so i am thinking that this is some really weird IE problem i have not yet found, or it may be a cache problem, but PHP cache control headers have no effect
any ideas pls?
check that also
[p2p.wrox.com...]
also that link is not really relevant. let me explain
i have a parent page, that contains (1 for the moment) iframe. teh source of the iframe is a php page that accesses db and returns a flash player that auto plays a media stream. so the page holding the flash player playing the stream is in hte iframe (but hiddne cause iframe size is 1,1)
the problem is taht whenever i reload the page or target the iframe with another link it doesnt work. only the first link (the src link) works when the iframe is first loaded.
why is this so, i have no idea, it all works perfect in FF, if you want a test site link email me
This in combo with a forced refresh via header should work.
Now I remember some sort of similar trouble with IE
No way to refresh on my local machine but it worked 0n other machines
Did you try it on another machine?
If that thread moves in a PHP direction you might ask a mod to move the thread in PHP
it works for certain things but apparently not this
henry
thanx for your suggestion too, i will try that, this also means though that the client must have javascript enabled or i cant 'dynamically' concat the string to the target url.
ill let you know
g00fy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
<!-- // ------------------------------------------------------------------------- // -->
<!-- webaudio content follows -->
<iframe src="http://www.example.com.au/webaudio/play_media.php?mid=746f796f74613a746f796f7461&bc=000000&w=63&h=21&ap=1&refresh=240012" name="audio_frame" id="audio_frame" frameborder="0" width="1" height="1" scrolling="no" style="background-color:#000000;"></iframe>
<!-- end webaudio content -->
<!-- // ------------------------------------------------------------------------- // -->
<p align="center">
<a href="index.php" >
<img src="images/toyota_1.png" border="0" />
</a>
</p>
<p align="center">
<a href="iindex.php" >
<img src="images/toyota_2.png" border="0" />
</a>
</p>
<p align="center">
<a href="iiindex.php" >
<img src="images/toyota_3.png" border="0" />
</a>
</p>
</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>
notice that href page changes by number of 'i' prefix
so i have three pages in dir, one for each images audio
could this be anything other than a cache problem?
sorry henry i have tried it on other machines than my test machine and server
regards,
g00fy
the page that holds the iframe needs to be targetted with play_media.php?args
i realise this is more php, but you have offered that this is acheivable
if i target it with play_mediaxyz123.php?args, where do i catch this at to strip out the xyz123 and return the play_media.php?args
kind regards,
g00fy
It should not be striped but red out of your DB (the extension)
So in my mind I envision a template that will be copied then written on with the new extension in such a way that it always is a new file
If not only the extension but also the whole file is loaded in your DB you will have to write a script that will del any file old instances
As I mentioned earlier the whole thing might become a PHP thread
Have you tried to post in “site graphic and multi media”
Next
has to be an iframe, because i might have several on one page at random locations (random, meaning more scattered than framesets allow)
Simply: create a page template with for ex 10 predetermined snippets location
And than only deal with including the snippets randomly or at a predetermined location, so you keep some form of random within a controlled situation
but that is not how it works, the mid hash is the query that returns a link to the media file, nothing else.
i will try and ask this question in the multimedia fora
also, iframe was being used as a remoting idea, so the 'main' page didnt have to be refreshed.
the problem (i think) will not be fixed by using forms either as i had a test version using the form idea and it did not work BUT all images were asking for the same media file, so MAYBE (hoping desperately) it will work for distinct media files.
otherwise i put a big banner at top of page that reads
.... IE does not conform to standards, please download firefox to hear this web pages voice ....
:D
thanx for all your suggestions
regards,
g00fy