Código PHP:
<?php
if($temporal == "/images/lluvia.gif"){
$sonido = rand(1,2);
if($sonido == 1){
echo "<embed src=\"/sounds/THUNDR1.mp3\" autostart=\"true\" style=\"width: 0; height: 0;
volume: 100%;\" loop=\"true\" />";
}elseif($sonido == 2){
echo "<embed src=\"/sounds/THUNDR2.mp3\" autostart=\"true\" style=\"width: 0; height: 0;
volume: 100%;\" loop=\"true\" />";
}
}elseif($temporal == "/images/soleado.jpg"){
$sonido2 = rand(1,2);
if($sonido2 == 1){
echo "<embed src=\"/sounds/sea24.mp3\" autostart=\"true\" style=\"width: 0; height: 0;
volume: 100%;\" loop=\"true\" />";
}elseif($sonido2 == 2){
echo "<embed src=\"/sounds/WIND1.mp3\" autostart=\"true\" style=\"width: 0; height: 0;
volume: 100%;\" loop=\"true\" />";
}
}
?>