Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
</head>
<body>
<?php
if fopen("dati.txt","rw")=1{
$dati=fopen("dati.txt","rw");}
else{ exit("Impossibile aprire il file");}
if fgets($dati, 1)=1{$buffer=fgets($dati, 1);}else
{check()};
function_check(){
$rand=rand([1],6);
fwrite("$dati", "$rand");
if fwrite("$dati", "$rand")=1{return true; }else{exit("Impossibile scrivere il file");}
fclose($dati); ?>
</p>
[img]<?php echo $buffer; ?> .gif[/img]
<input name="Refresh..." type="button" onclick="refresh_location();" value="Refresh..." />
<input name="Tira il dado" type="button" onclick="parent.check();" value="Tira il dado" />
</p>
<iframe src="google.com" height="400" width="500">chat</iframe>
</p>
</p>
</body>
</html>
Parse error: syntax error, unexpected T_STRING, expecting '(' in /membri2/blognetwork/lol/main.php on line 10
Ricevo sempre questo errore,nn riesco a capire ne quale sia la riga interessata in quanto non ho stringhe con '('
VVoVe:
C'è qualcuno che mi può dare una mano?Sono ancora noob
Il mio intento è formulare un numero random che potrebbe essere un dado e scriverla sottoforma di immagine
ma che sia visibile anche dagli altri utenti quando fanno il refresh,quindi ho pensato a scrivere i dati su file e poi
prendirli quando qualcuno visita la pagina.Se sono presenti li mostra,altrimenti riesegue il ciclio check()