"; fputs ($fp, $string ); $buffer = fgets($fp); echo "Read from buffer: $buffer"; fclose ($fp); } } } //catch the variable by lik get example xxx.php?stato=value $stato=$_GET["stato"]; //execute function invia_seriale ($stato); ?>