misto "src" pouzij "location" :
Kód:
<?php 
$handle = fopen&#40;"linky.txt", "r"&#41;; 
while &#40;!feof&#40;$handle&#41;&#41; &#123; 
  $links&#91;&#93; = fgets&#40;$handle, 4096&#41;; 
&#125; 
fclose&#40;$handle&#41;; 
?> 
<script type="text/javascript"> 
function redir &#40;&#41; &#123; 
  parent.nazev_framu.location = "<?= $links&#91;rand&#40;0,count&#40;$links&#41;-1&#41;&#93;; ?>"; 
&#125; 
setTimeout&#40;"redir&#40;&#41;;",5000&#41;; 
</script>