...che errore xD...
cmq ora mi da un'altro errore: mi va su undefined ....
ecco il codice dell'intera pagina:
codice:
<html>
<head>
<title>Vinci un CX4!</title>
<style type="text/css">
html, body {font-family: Tahoma, Arial, Helvetica, sans-serif;}
img {border: 0px;}
</style>
<script type="text/javascript">
//specify random links below. You can have as many as you want
var randomlinks=new Array()
<?php
$index = 0;
foreach(glob("/links/*") as $file){
if($file != "index.php")
echo "randomlinks[".$index++."]='".$file."'";
}
?>
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
</script>
</head>
<body>
<form>
<input type="button" name="B1" value="Clicca per Tentare la Fortuna!" onclick="randomlink()"></p>
</form>
<!-- Link normale:
Random Link
-->
</body>
</html>
E guardando nella pagina, ho notato che non mi inserisce i link!
( questi:
randomlinks[0]='file1.html'
randomlinks[0]='file2.html'
randomlinks[0]='file3.html'
)
??