ok ma non sembra funzionare cmq...ho un hosting windows su aruba..ho messo le varie cartelle con cui devo lavorare(creare files, scriverci dentro e salvarli) nell cartella "public" ke dovrebbe essere dotata di tutti i diritti...ma mi da un errore in questa function:
@define ("MYSQL_CONNECT_INCLUDE", "connect_db.php"); //MySQL database connection (a sample file is included)
@define ("REPORT_FILE_URL", "http://www.dominio.it/public/pireps/logs/"); // URL where the complete FSAcars reports will be stored
@define ("REPORT_FILE_PATH", "d:/Inetpub/webs/dominioit/public/pireps/logs/"); // Folder where the complete FSAcars reports will be stored
@define ("ERROR_LOG_PATH", "d:/Inetpub/webs/dominioit/public/pireps/logs/error.log"); // Folder and filename where the error log is located
/*
* Error messages */
@define ("ERROR_OPENING_REPORT_FILE","Error opening report file");
@define ("ERROR_WRITING_REPORT_FILE","Error writing report file");
@define ("PILOT_NOT_FOUND","Pilot not found");
@define ("ERROR_IN_PILOT_QUERY","Pilot query error");
@define ("ERROR_INSERTING_PIREP","Error inserting report");
function SavePIREPFile($pirep_array) {
/* ************************************************** **********************************************
@SavePIREPFile
Receives a string array with FSAcars pireps and creates or appends information to pirep file
Inputs: string array
Outputs: 1 sucess, 0 error
************************************************** ********************************************** */
/* Build report filename and URL */
$filename=$pirep_array['pilot'].str_replace("/","",$pirep_array['date']).str_replace(":","",$pirep_array['time']).".txt";
$pirep_array['rep_url']=REPORT_FILE_URL.$pirep_array['pilot']."/".$filename;
/* Parse FsAcars log */
$fsacars_log_lines_array = explode("*",$pirep_array['fsacars_log']);
/* Create or Append FSAcars report file */
$fp = fopen (REPORT_FILE_PATH.$pirep_array['pilot']."/".$filename, "a");
if (!$fp) {
/* Error opening file */
$fe = fopen (ERROR_LOG_PATH, "a");
fwrite($fe, "[ERROR ".date("d.m.y H:i:s")."] PILOT: ".$pirep_array['pilot']." - ".ERROR_OPENING_REPORT_FILE." - ".$filename."\n");
fclose($fe);
return 0;
}
/*
* Write all log lines received from FSAcars */
for($i=0;$i<count($fsacars_log_lines_array);$i++) {
if (!fwrite($fp, $fsacars_log_lines_array[$i] . "\n")) {
/* Error writing to file */
$fe = fopen (ERROR_LOG_PATH, "a");
fwrite($fe, "[ERROR ".date("d.m.y H:i:s")."] PILOT".$pirep_array['pilot']." - ".ERROR_WRITING_REPORT_FILE." - ".$filename."\n");
fclose($fe);
return 0;
}
}
/* Close file */
fclose($fp);
return 1;
}
AIUTATEMII!! PER FAVOREEE!
GRAZIE
DAvide