PLAYING A SOUND FILE NO MORE THAN ONCE IN A SPECIFIED TIME PERIOD - Aug 3rd, 2010


This code gets placed a the very head of your page, before the “require once” code.



<?php
$expire=time()+60*60*24;
setcookie("firsttime","no", $expire ); ?>



In this example the duration is set to 1 Day (60 seconds * 60 Minutes * 24 hours)

And this code gets placed right after your <body> tag:



<?php
$firsttime = $_COOKIE[firsttime];
if (@
$firsttime != "no") { echo "<embed src='http://www.yoursite.com/yourgreeting.mp3' width=0 height=0 />"; }
?>


The width and height are set to “0" so that the player is invisible on the page.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service