E' sorto un problema:
codice:
<script>
<!--
//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>
Il codice PHP lo devo inserire all'interno di uno script...
L'errore che mi da google chrome è:
Parse error: syntax error, unexpected T_VARIABLE in /membri/cap123/wr/concorso/concorsi/cx4/index.php on line 12