Campo obbligatorio, invio ([SI],NO) _>, risposta (SI,NO) //CLASSICI //[ita] = "Tipo"; //[eng] = "Tipo Eng"; //[tipo] = "select"; //tipo2 = doppiaconferma //[val][xxx] = "Rivenditore|Architetto-Geometra"; //[val][sel] = "Rivenditore"; //[val][def] = "scrivere qualcosa"; //[obb] = "SI"; //forzo obbligatorio //[err] = "NO"; //tolgo controllo errore //[css] = "assenga la classe css all'elemento html"; //TEMPLATE di sovrascrittura locale se serve //if($F[$k][f_form_tpl]) $f_form_tpl = $F[$k][f_form_tpl]; //else $f_form_tpl = $F[f_form_tpl]; //definisco i nomi dei campi che servono al programma $F[f_nome_form] = "FORM"; $F[f_campo_email] = "email"; $F[f_campo_nome] = "nome"; //il nome visualizzato nel template $F[f_email_dest] = "AUTO"; //prende da indi $F[f_email_copia] = "AUTO"; //prende da indi $F[f_email_cc] = "AUTO"; //prende da indi $F[f_email_indi] = "AUTO"; //prende da indi $F[f_nome_sito] = "AUTO"; //prende da indi $F[f_tabella] = NULL; //nome tabella database $F[f_duepunti] = ":"; $F[f_txt_t] = "#ASTERISCO##NOME##DUEPUNTI#\n\r"; $F[f_err] = "*"; $F[f_css_sel] = "style=\"border-color:#FF0000\""; //stile selezionato casella generica $F[f_css_rc] = "style=\"background-color:#FF0000\""; //stile selezionato casella radio e box $F[f_css_sel_select] = "style=\"background-color:#FF0000\""; //stile selezionato casella select $F[f_lingua_alt] = "eng"; //linga alternativa se non disponibile la traduzione $F[f_submit][ita] = "Invia la richiesta"; //nome del tasto $F[f_submit][eng] = "Submit your request"; //nome del tasto $F[f_submit][ger] = "Anfrage absenden"; //nome del tasto $F[f_submit][fra] = "Envoyer votre demande"; //nome del tasto //definizione campo errori e errore anche in lingua $F[f_erro_temp][xxx] = "
  • #ERRORE#
  • "; $F[f_dato_temp][xxx] = "
  • #CAMPO#: #DATO#
  • \n\r"; $F[f_txt_doppiaconferma][eng] = "please retype"; $F[f_txt_doppiaconferma][ita] = "prego riconfermare"; $F[f_txt_doppiaconferma_err][eng] = "must to be the same"; $F[f_txt_doppiaconferma_err][ita] = "devono essere uguali"; //testi vari in lingua $F[f_txt_head][ita] = "Modulo richiesta informazioni
    I campi con l' asterisco (*) sono obbligatori
    \n\r"; $F[f_txt_head][eng] = "Request informations
    Fields marked with asterisk (*) are required
    \n\r"; $F[f_txt_head][ger] = "Fragebogen zur Informationsanfrage.
    (*) Die mit Stern gekennzeichneten Felder sind obligatorisch
    \n\r"; $F[f_txt_head][fra] = "Formulaire de demande d'informations
    (*) es champs marqués d'un astérisque sont obligatoires
    \n\r"; $F[f_txt_errore][ita] = "
    Errore, riempire i seguenti campi obbligatori:
    \n\r"; $F[f_txt_errore][eng] = "
    Error, fill the required field:
    \n\r"; $F[f_txt_errore][ger] = "
    Fehler, bitte die folgenden obligatorischen Felder ausfüllen:
    \n\r"; $F[f_txt_errore][fra] = "
    Erreur, remplir les champs obligatoires suivants:
    \n\r"; $F[f_txt_invio][ita] = "Grazie #NOME# per aver compilato il nostro modulo, di seguito i dati inviati:


    << Ritorna alla Home Page
    \n\r"; $F[f_txt_invio][eng] = "Thanks #NOME# for the request:


    << Return to Home Page
    \n\r"; $F[f_txt_invio][ger] = "#NOME# Wir danken Ihnen, dass Sie unseren Fragebogen ausgefüllt haben, hier die übersandten Daten:


    << zurück zur Home-Page
    \n\r"; $F[f_txt_invio][fra] = "#NOME# Merci d'avoir rempli notre formulaire, ci-après les données communiquées:


    << Retour à la Page d'accueil.
    \n\r"; $F[f_txt_email][ita] = "Indirizzo E-mail non corretto!\n\r"; //Lingua di risposta del FORM $F[f_txt_email][eng] = "Wrong E-mail address!\n\r"; //Lingua di risposta del FORM $F[f_txt_email][ger] = "E-Mail-Anschrift nicht korrekt!\n\r"; //Lingua di risposta del FORM $F[f_txt_email][fra] = "Adresse e-mail incorrecte!\n\r"; //Lingua di risposta del FORM //Messaggio che arriva al proprietario della struttura $F[f_lingua_form] = "AUTO"; //linga automatica in base alla lingua della pagina ???? $F[f_nomecognome] = "AUTO"; $F[f_email_form] = "AUTO"; $F[f_invio_agg] = "SI"; //Invio anche i dati aggiuntivi $F[f_form_tpl] = " - #NCAMPO#: #VCAMPO# \n\n"; $F[f_oggetto][xxx] = "Richiesta [#SITO#] - #NOME#"; $F[f_testo][xxx] = "Messaggio di richiesta informazioni ricevuto dal form del sito (#SITO#)\nPer inviare una risposta al messaggio potete semplicemente rispondere a questa e-mail!\n\n\n#MESSAGGIO#\n\nPer Qualsiasi problema contattare TNX snc - Tel: 0577980701 - E-mail: info@tnx.it"; $F[f_testo_msg][ita] = "MESSAGGIO"; $F[f_testo_msg][eng] = "MESSAGE"; //CAMPI SELECT PREIMPOSTATI $F[f_txt_nazioni][xxx] = " |Andorra|Argentina|Australia|Austria|Belgium|Bolivia|Brazil|Bulgaria|Canada|Colombia|Costa Rica|Croatia|Cuba|Cyprus|Czech Republic|Denmark|Dominican Republic|Ecuador|Egypt|Estonia|France|Germany|Greece|Guadeloupe|Hungary|Ireland|Israel|Italy|Kenya|Kuwait|Latvia|Lithuania|Luxembourg|Malaysia|Malta|Mauritius|Mexico|Morocco|Mozambique|Netherlands|Norway|Peru|Poland|Portugal|Romania|Russia|San Marino|Senegal|Slovak Republic|Slovenia|Spain|Sweden|Switzerland|Thailand|Tunisia|Turkey|Ukraine|United Kingdom|Uruguay|USA|Vietnam| Other"; $F[f_txt_nazioni][ita] = " |Andorra|Argentina|Australia|Austria|Belgium|Bolivia|Brazil|Bulgaria|Canada|Colombia|Costa Rica|Croatia|Cuba|Cyprus|Czech Republic|Denmark|Dominican Republic|Ecuador|Egypt|Estonia|France|Germany|Greece|Guadeloupe|Hungary|Ireland|Israel|Italy|Kenya|Kuwait|Latvia|Lithuania|Luxembourg|Malaysia|Malta|Mauritius|Mexico|Morocco|Mozambique|Netherlands|Norway|Peru|Poland|Portugal|Romania|Russia|San Marino|Senegal|Slovak Republic|Slovenia|Spain|Sweden|Switzerland|Thailand|Tunisia|Turkey|Ukraine|United Kingdom|Uruguay|USA|Vietnam| Altra"; $F[f_txt_province][xxx] = " |AG|AL|AN|AO|AR|AP|AT|AV|BA|BL|BN|BG|BI|BO|BZ|BS|BR|CA|CL|CB|CE|CT|CZ|CH|CO|CS|CR|KR|CN|EN|FE|FI|FG|FC|FR|GE|GO|GR|IM|IS|SP|AQ|LT|LE|LC|LI|LO|LU|MC|MN|MS|MT|ME|MI|MO|NA|NO|NU|OR|PD|PA|PR|PV|PG|PU|PE|PC|PI|PT|PN|PZ|PO|RG|RA|RC|RE|RI|RN|RM|RO|SA|SS|SV|SI|SR|SO|TA|TE|TR|TO|TP|TN|TV|TS|UD|VA|VE|VB|VC|VR|VV|VI|VT"; $F[f_txt_giorni][xxx] = " |1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31"; $F[f_txt_mesi][xxx] = " |1|2|3|4|5|6|7|8|9|10|11|12|"; $F[f_txt_anni][xxx] = " |2006|2007|2008|2009"; //template form automatica $F[f_table_t][xxx] = "
    #FORM#
    #HEADER#
    #ERRORI#
     
    "; //template riga $F[f_table_riga_t][xxx] = "#NOME_CAMPO##CAMPO#"; //template risposta $F[f_table_risp_t][xxx] = "
    #CONFERMA#

    "; $F[f_table_risp_t][xxx] = "
    #CONFERMA#

    "; //css delle form di base si possono sovrascrivere $F[f_css][xxx] = " .$F[f_nome_form] { border-style: solid; border-color: #999999; background-color: #FAFAFA; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } .$F[f_nome_form]_head { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-align: center; display: block; } .$F[f_nome_form]_err { color:#FF0000; font-weight:bold; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .$F[f_nome_form]_txt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } .$F[f_nome_form]_table { font-size: 11px; } "; function f2_init(){ global $DATI,$LANG,$F,$FORM,$FORM_SQL; //unset($F); //#INIZIO PROGRAMMA PRINCIPALE $lang = $DATI[lang]; $lang_alt = $F[f_lingua_alt]; //sistemo campi lingua in automatico while (list ($k, $v) = @each ($F)) { while (list ($kk, $vv) = @each ($v)) { while (list ($kkk, $vvv) = @each ($vv)) { //sistemo gli xxx negli array di 3 livello if($kkk == "xxx") { $F[$k][$kk][$lang] = $vvv; } if($kkk == $lang_alt) { //sostituisco lingue non complete con la lingua di default reset($LANG); while (list ($kl, $vl) = @each ($LANG)) { if($kl != $lang_alt) { if($F[$k][$kk][$kl]=="") $F[$k][$kk][$kl] = $vvv; } } } } //sistemo gli xxx negli array di secondo livello if($kk == "xxx") { $F[$k][$lang] = $vv; } if($kk == $lang_alt) { //sostituisco lingue non complete con la lingua di default reset($LANG); while (list ($kl, $vl) = @each ($LANG)) { if($kl != $lang_alt) { if($F[$k][$kl]=="") $F[$k][$kl] = $vv; } } } } } //inizializzo l' array $nome_form = $F["f_nome_form"]; //tolgo gli salsh se magick quote attive $FORM = dataquote($_POST[$nome_form]); //creo versione per DB con quote $FORM_SQL = dbquote($_POST[$nome_form]); //_________________ANTI SPAM _______________________ //mi copio i dati $FORM_SPAM = $FORM; //chiavi di ricerca $sicur_r = array(0=>"content-type:",1=>"charset=",2=>"mime-version:",3=>"multipart/mixed",4=>"bcc:"); //metto tutto minuscolo function sicur_piccole(&$elemento1) { $elemento1 = strtolower($elemento1); } @array_walk ($FORM_SPAM,'sicur_piccole'); //print_r($FORM2); @reset($FORM_SPAM); while(list($k,$v) = @each($sicur_r)) { //cecca, problema che array_search credo trovi solo se il valore è uguale non se contiene //$sicur_e[$v] = @array_search($v,$FORM2); //if($sicur_e[$v]) $SPAM = "SI"; if ($FORM2 !== null && is_array($FORM_SPAM)) { foreach ($FORM_SPAM as $ee) { if (stripos ($ee, $v) !== false) { $sicur_e[$v] = true; $SPAM = "SI"; } } } } //setto l' e-mail di destinazione e i campi auto if($F[f_email_dest] == "AUTO") $F[f_email_dest] = $DATI[email]; if($F[f_email_copia] == "AUTO") $F[f_email_copia] = $DATI[email_copia]; if($F[f_email_cc] == "AUTO") $F[f_email_cc] = $DATI[email_cc]; if($F[f_email_indi] == "AUTO") $F[f_email_indi] = $DATI[email_indi]; if($F[f_nome_sito] == "AUTO") $F[f_nome_sito] = $DATI[dominio_sito]; if($F[f_nomecognome] == "AUTO") { $campo_nome = $F[f_campo_nome]; $F[f_nomecognome] = $FORM[$campo_nome]; } if($F[f_email_form] == "AUTO") { $campo_email = $F[f_campo_email]; $F[f_email_form] = $FORM[$campo_email]; //if($F[f_email_form] == "") mail($CONF[email_indi],"INDI - Errore form",$DATI[dominio_sito]); } //controllo obbligatori su modo 1 $OBB_ARRAY = explode("|",$F[f_obb][$lang]); //imposto forzatamente per compatibilita' if (sizeof($OBB_ARRAY) > 1) { while(list($k,$v) = @each($OBB_ARRAY)) { $F[$v][obb] = "SI"; } } //adesso ho l' array di compatibilita e ricreo quello definitivo F_OBB reset($F); while(list($k,$v) = @each($F)) { //creo array campi obbligatori //print "#".$v["obb"]."#$k"; if($v["obb"] == "SI") $F_OBB[$k] = "SI"; } //controllo campi obbligatori ci deve essere anche l' e-mail while(list($k,$v) = @each($F_OBB)) { //controllo obbligatori // //print $F[$k][def][$lang]; //controllo campo di default, se presenti non da' errore su questi if($F[$k][err] != "NO") { if($F[$k][tipo2] == "" and $F[$k][obb]== "SI" and trim($FORM[$k]) == "" or ($FORM[$k] == $F[$k][def][$lang] and is_array($F[$k][def]))) { //gestisco errore campi obbligatori $obb = "SI"; //imposto array con gli errori relativi ai campi $F[f_errori][$k] .= $F[$k][$lang]; } //controllo campi e-mail se definiti ??? devo aggiungere controllo automatico, che valida la mail ovenuque e' if($F[$k][tipo2] == "email") { //MODIFICATO PERCHE' NON CONSIDERAVA IL CAMPO EMAIL OBBLIGATORIO //if(vemail(trim($FORM[$k])) != 0 and trim($FORM[$k]) != "") $F[f_errori][$k] .= $F[f_txt_email][$lang]; if(vemail(trim($FORM[$k])) != 0 or trim($FORM[$k]) == "") $F[f_errori][$k] .= $F[f_txt_email][$lang]; } //controllo per doppia conferma bisogna creare un campo alias if($F[$k][tipo2] == "doppiaconferma") { if(($F[$k][obb]== "SI" and trim($FORM[$k]) != "" and trim($FORM[$k."_alias"]) == "") or $FORM[$k] != $FORM[$k."_alias"]) { //gestisco errore campi obbligatori $obb = "SI"; ///if($FORM[$k] != $FORM[$k."_alias"]) $F[f_errori][$k] .= "Riconfermare la .."; if(trim($FORM[$k] != "") and trim($FORM[$k."_alias"] != ""))$F[f_errori][$k."_alias"] .= $F[$k][$lang]." (".$F[f_txt_doppiaconferma_err][$lang].")"; else $F[f_errori][$k."_alias"] .= $F[$k][$lang]." (".$F[f_txt_doppiaconferma][$lang].")"; //doppiuo controllo //imposto array con gli errori relativi ai campi } } //controllo per file if($F[$k][tipo2] == "file") { if(!is_uploaded_file($_FILES['file']['tmp_name'])) $F[f_errori][$k] .= $F[$k][$lang]; } } } if(!is_array($FORM)) unset($F[f_errori]); } function f2($nome,$AGG=NULL) { global $F,$FORM,$DATI; //assegno valore $valore = $FORM[$nome]; //lingua $lang = $DATI["lang"]; //controllo aggiuntivi if($AGG == NULL) $AGG = $F[$nome][agg]; $nome_form = $F["f_nome_form"].'['.$nome.']'; //genero il nome del CSS if($F[$nome][css] == "") $CSS = 'class="'.$F[f_nome_form].'"'; else $CSS = 'class="'.$F[$nome][css].'"'; //imposto obbligatorio if($F[f_errori][$nome] != "") $obb="SI"; //SOLO TESTO ################## if($F[$nome][tipo] == "solotxt") { return ""; } //TEXT ################## if($F[$nome][tipo] == "text") { if($obb == "SI") $STYLE=$F[f_css_sel]; //controllo campo default if(is_array($F[$nome][def]) and !is_array($FORM)) $valore = $F[$nome][def][$lang]; return ''; } //PASSWORD ################## if($F[$nome][tipo] == "password") { if($obb == "SI") $STYLE=$F[f_css_sel]; //controllo campo default if(is_array($F[$nome][def]) and !is_array($FORM)) $valore = $F[$nome][def][$lang]; return ''; } //FILE ################## if($F[$nome][tipo] == "file") { if($obb == "SI") $STYLE=$F[f_css_sel]; //controllo campo default //if(is_array($F[$nome][def]) and !is_array($FORM)) $valore = $F[$nome][def][$lang]; // //return ''; return ''; } //HIDDEN ################## if($F[$nome][tipo] == "hidden") { //if($obb == "SI") $STYLE=$F[f_css_sel]; //controllo campo default if(is_array($F[$nome][def]) and !is_array($FORM)) $valore = $F[$nome][def][$lang]; return ''; } //CHECKBOX ################## if($F[$nome][tipo] == "checkbox") { if($obb == "SI") $STYLE=$F[f_css_rc]; if($F[$nome][stato] == "selezionato" and $valore != "") $stato = "checked"; if($valore == $F[$nome][sel][$lang]) $stato = "checked"; return ''; } //TEXTAREA ################## elseif($F[$nome][tipo] == "textarea") { if($obb == "SI") $STYLE=$F[f_css_sel]; if(is_array($F[$nome][def]) and !is_array($FORM)) $valore = $F[$nome][def][$lang]; return ''; } //SELECT ################## elseif($F[$nome][tipo] == "select") { if($obb == "SI") $STYLE=$F[f_css_sel_select]; $stato = ""; $VALORI = explode ("|",$F[$nome][val][$lang]); reset($VALORI); while(list($k, $v)=each($VALORI)) { if(trim($v) == $F[$nome][sel][$lang] and trim($v) != "") $selezionato = TRUE; else $selezionato = FALSE; if(trim($v) == trim($valore) or $selezionato) $stato = "selected=\"selected\""; else $stato = ""; $out .= ''; } return ''; } //SELECT KV ################## elseif($F[$nome][tipo] == "select_kv") { if($obb == "SI") $STYLE=$F[f_css_sel_select]; $stato = ""; //$VALORI = explode ("|",$F[$nome][val][$lang]); $VALORI = $F[$nome][val][$lang]; reset($VALORI); while(list($k, $v)=each($VALORI)) { if(trim($k) == $F[$nome][sel][$lang] and trim($k) != "") $selezionato = TRUE; else $selezionato = FALSE; if(trim($k) == trim($valore) or $selezionato) $stato = "selected"; else $stato = ""; $out .= ''; } return ''; } //DATA ################## elseif($F[$nome][tipo] == "data") { if($obb == "SI") $STYLE=$F[f_css_sel_select]; $stato = ""; //$VALORI = explode ("|",$F[$nome][val][$lang]); $VALORI = $F[$nome][val][$lang]; reset($VALORI); while(list($k, $v)=each($VALORI)) { if(trim($k) == $F[$nome][sel][$lang] and trim($k) != "") $selezionato = TRUE; else $selezionato = FALSE; if(trim($k) == trim($valore) or $selezionato) $stato = "selected"; else $stato = ""; $out .= ''; } return ''; } //RADIO ################## elseif($F[$nome][tipo] == "radio") { if($obb == "SI") $STYLE=$F[f_css_rc]; $stato = ""; $VALORI = explode ("|",$F[$nome][val][$lang]); $AGG = $VALORI[$AGG-1]; if($AGG == $valore) $stato = "checked"; else $stato = ""; return ''; } } function f2_submit() { global $F,$DATI; $lang = $DATI["lang"]; return encode($F[f_submit][$lang]); } function f2_merge($nome) { global $F; if(is_array($F[$nome])) { if(isset($F[$nome]["f_duepunti"])) $F["f_duepunti"] = $F[$nome]["f_duepunti"]; if(isset($F[$nome]["f_txt_t"])) $F["f_txt_t"] = $F[$nome]["f_txt_t"]; } } //stampa il nome function f2n($nome,$AGG=NULL) { global $F, $DATI; //merge f_merge($nome); $lang = $DATI["lang"]; //if($F[f_txt_stili] == "SI") $out = ''.$F[$nome][$lang].''; if($F[f_err] != "" and $F["$nome"]["obb"] == "SI"){ $out = str_replace("#ASTERISCO#",$F[f_err],$F[f_txt_t]); } else $out = str_replace("#ASTERISCO#","",$F[f_txt_t]); //template per il testo $out = str_replace("#NOME#",$F[$nome][$lang],$out); $out = str_replace("#NOME_FORM#",$F[f_nome_form],$out); $out = str_replace("#DUEPUNTI#",$F[f_duepunti],$out); return encode($out); } function f2_crea_form($nome_form=NULL) { //ciclo principale } function f2_errori($nome_form=NULL) { global $F,$FORM,$DATI; if(is_array($F[f_errori])) { $lang = $DATI[lang]; //creo errori reset($F[f_errori]); while(list($k, $v)=@each($F[f_errori])) { $errori .= str_replace("#ERRORE#",$v,$F[f_erro_temp][$lang]); } $out = str_replace("#ERRORI#",$errori,$F[f_txt_errore][$lang]); $out = str_replace("#NOME_FORM#",$F[f_nome_form],$out); return encode($out); } else return FALSE; //ciclo principale } function f2_invio($nome_form=NULL) { //sistemo variabili //inizializzo form //se non ci sono errori ed e' stato premuto il pulsante invia, mando conferma ed e-mail global $F,$FORM,$DATI,$STAT; $lang = $DATI[lang]; //in ogni caso se ci sono errori torna FALSE if(!is_array($F[f_errori]) and is_array($FORM)) { //mando e-mail //sistemo oggetto $F[f_oggetto][$lang] = str_replace("#SITO#",$F[f_nome_sito],$F[f_oggetto][$lang]); $F[f_oggetto][$lang] = str_replace("#NOME#",$F[f_nomecognome],$F[f_oggetto][$lang]); //creo ordine dei campi (possibile retroproblema) ???? da finire //@reset($F); //while (list ($k, $v) = each ($F)) { // if($F[$k][tipo] != "") $ORD[] = $k; //} //print_r($ORD); @reset($FORM); while (list ($k, $v) = each ($FORM)) { if($v != "") { //controllo se l' invio e' disabilitato (FLAG invio) if($F[$k][invio] != "NO") { //TEMPLATE mi prendo la configurazione del campo senno' quella gobale if($F[$k][f_form_tpl]) $f_form_tpl = $F[$k][f_form_tpl]; else $f_form_tpl = $F[f_form_tpl]; //costruisco risposta $stringa1 = ""; $stringa1 = str_replace("#NCAMPO#",$F[$k][$lang],$f_form_tpl); $stringa .= str_replace("#VCAMPO#",$v,$stringa1); //$stringa .= "- ".$F[$k][$lang].": $v \n\n"; } } } //intorno al messaggio //$riga_prima .= "\n-------------------------- ".$F[f_testo_msg][$lang]." --------------------------\n"; //$riga_dopo .= "\n---------------------------------------------------------------"; //sistemo messaggio $messaggio = str_replace("#SITO#",$F[f_nome_sito],$F[f_testo][$lang]); $messaggio = str_replace("#MESSAGGIO#",$riga_prima.$stringa.$riga_dopo,$messaggio); $messaggio = str_replace("#NOME_FORM#",$F[f_nome_form],$messaggio); $messaggio = str_replace("#NOME#",$F[f_nomecognome],$messaggio); //info prima e dopo //$messaggio = $F[f_msg_prima].$messaggio.$F[f_msg_dopo]; $messaggio_agg .= "\n---------------------------------------------------------------"; $messaggio_agg .= "\n\nDATI AGGIUNTIVI FORM\n"; $messaggio_agg .= "Pagina\t\t -> ".$DATI[pagina]."\n"; $messaggio_agg .= "Lingua\t\t -> ".$DATI[lang]."\n"; $messaggio_agg .= "Param\t\t -> ".$DATI[agg]."\n"; $messaggio_agg .= "ID Sessione\t\t -> ".$STAT[sessione]."\n"; $messaggio_agg .= "Lingua\t\t -> ".$STAT[lingua]."\n"; $messaggio_agg .= "Provenienza\t\t -> ".$STAT[ref]."\n"; $messaggio_agg .= "Data\t\t -> ".strftime("%D")."\n"; $messaggio_agg .= "Ora\t\t -> ".strftime("%T")."\n"; $messaggio_agg .= "Pagine\t\t -> ".$STAT[count_pagina]."\n"; $messaggio_agg .= "Tempo\t\t -> ".$STAT[tempo]." sec.\n"; $messaggio_agg .= "IP\t\t -> $_SERVER[REMOTE_ADDR]\n"; $messaggio_agg .= "Host\t\t -> $STAT[host]\n"; $messaggio_agg .= "Browser\t\t -> $_SERVER[HTTP_USER_AGENT]\n"; //controllo aggiuntivi if($F[f_invio_agg] == "SI") $messaggio_agg2 = $messaggio_agg; else $messaggio_agg2 = ""; //header creo indirizzo mittente $F[f_from] = 'From: "'.$F[f_nomecognome].' ('.$F[f_email_form].')" <'.$F[f_email_form].'>'."\r\n"; //header e-mail cc di indi per uso nei sito if($F[f_email_cc] != "") { $CC = "Cc: $F[f_email_cc] \r\n"; } //e-mail principale del form con eventuale CC if ($F[f_email_dest] != "") mail_check($F[f_email_dest], $F[f_oggetto][$lang],$messaggio.$messaggio_agg2,$F[f_from].$CC); //e-mail di copia ed e-mail di INDI //imposto un po' di dati aggiuntivi if($F[f_email_indi] != "" and $F[f_email_dest] != "") { mail_check($F[f_email_indi], "INDI:FORM:".$F[f_oggetto][$lang],$messaggio.$messaggio_agg,$F[f_from]); } //copia webmaster if($F[f_email_copia] != "") { mail_check($F[f_email_copia], "COPIA: ".$F[f_oggetto][$lang],$messaggio,$F[f_from]); } //creo output resoconto reset($FORM); while(list($k, $v)=@each($FORM)) { if($v != "") { if($F[$k][risposta] != "NO") { $dati_tmp = nl2br(str_replace("#DATO#",$v,$F[f_dato_temp][$lang])); $campo = $F[$k][$lang]; $dati .= str_replace("#CAMPO#",$campo,$dati_tmp); } } } $out = str_replace("#DATI#",$dati,$F[f_txt_invio][$lang]); $out = str_replace("#NOME#",$F[f_nomecognome],$out); $out = str_replace("#NOME_FORM#",$F[f_nome_form],$out); //d($messaggio,"MESSAGGIO"); //d($out,"RISPOSTA"); return encode($out); } else { return FALSE; } } //header function f2_head($nome_form=NULL) { global $F,$DATI; $lang = $DATI[lang]; $out = str_replace("#NOME_FORM#",$F[f_nome_form],$F[f_txt_head][$lang]); return $out; } function f2_form() { global $F,$FORM,$DATI; f_init(); //DEBUG //d($F,"CONFIGURAZIONE"); d($FORM,"FORM"); //se non ci sono errori e if(!is_array($F[f_errori]) and is_array($FORM)) { return TRUE; } else return FALSE; } function f2_auto() { global $F,$DATI; $lang = $DATI[lang]; f_init(); //print "aa"; //creo la form if(f_invio() == FALSE) { reset($F); while(list($k, $v)=@each($F)) { if(is_array($v) and $v[tipo]) { $form_tmp = str_replace("#NOME_CAMPO#",fn($k),$F[f_table_riga_t][$lang]); $form_tmp = str_replace("#CAMPO#",f($k),$form_tmp); $form .= $form_tmp; } } $out_table = str_replace("#HEADER#",f_head(),$F[f_table_t][$lang]); $out_table = str_replace("#ERRORI#",f_errori(),$out_table); $out_table = str_replace("#SUBMIT#",$F[f_submit][$lang],$out_table); $out_table = str_replace("#FORM#",$form,$out_table); $out_table = str_replace("#NOME_FORM#",$F[f_nome_form],$out_table); return $out_table; } else { $out = str_replace("#CONFERMA#",f_invio(),$F[f_table_risp_t][$lang]); $out = str_replace("#NOME_FORM#",$F[f_nome_form],$out); return $out; } } ?>