views:

22

answers:

1

How can I append current time using PHP to the value attribute of the first param element in the following html fragment?

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
              <param id="sourcie" name="source" value="SClient.xap?**TIME**"/>
              <param name="onError" value="onSilverlightError" />
              <param name="background" value="white" />
              <param name="minRuntimeVersion" value="4.0.50401.0" />
              <param name="autoUpgrade" value="true" />
              <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0" style="text-decoration:none">
                      <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
              </a>
        </object>

I want to host a Silverlight client application on Sourceforge.net and could not find another working way to make browser not cache the Silverlight app.

UPDATE

Using file modified time now to avoid unnecessary reloading:

<param id="sourcie" name="source" value="SClient.xap?<?php echo filemtime('SClient.xap'); ?>" />
+2  A: 
<param id="sourcie" name="source" value="SClient.xap?<?php echo time(); ?>"/>
Crayon Violent
Thank u!!!!!!!!!!!!! Works like a charm ^__^ ... that saved me the day. Now the app is loaded afresh every time people visit my page.
Cetin Sert
...and that's really a good thing? Ok, if you says so...
VolkerK
@VolkerK: Hmm good follow-up question. I guess I should switch that to file modified time instead. <?php echo filemtime('SClient.xap'); ?> Current time is a bit of an overkill. Thanks for the hint!!
Cetin Sert