Pubblicazioni di Matrimonio

  Richiesta Password"; $ELENCOTAB .= "

  Utente............:

  Password.........:

  

"; } if ($TIT1 == "400") { $ELENCOTAB .= "

  Inserimento Pubblicazioni di Matrimonio

"; #$ELENCOTAB .= "Utente: $utente1
"; #$ELENCOTAB .= "Password: $password1
"; $NOME_TABELLA =$db_utenti; $DB =mysql_select_db($db_nome, $connessione) or die("Impossibile aprire il database"); $sql="SELECT * FROM $NOME_TABELLA WHERE USER='$utente1' AND PASSWORD='$password1'"; $RISULTATO = mysql_query($sql, $connessione) or die(mysql_error()); $OK= mysql_numrows($RISULTATO); while ($RIGA = mysql_fetch_array($RISULTATO)) { $user= $RIGA['USER']; $password= $RIGA['PASSWORD']; $nomeutente=$RIGA['NOMEUTENTE']; } if ($utente1 == Null) {$utente1 = "xqwer"; } if ($user != $utente1) { $ELENCOTAB .= "

Nome utente errato

  

"; } if ($password != $password1) { $ELENCOTAB .= "

Password errata

  

"; } if ($user == $utente1 && $password == $password1) { $ELENCOTAB .= "  Utente: $nomeutente"; $ELENCOTAB .= "

  Anno.....................:

  N. del Registro.......:

  Cognome e nome dello sposo:

  Cognome e nome della sposa:

  Data inizio pubblicazione..:

  Data termine pubblicazione:



  Documento:


  

"; } } #registra dati pubblicazione inserita if ($TIT1 == "500") { $datapub1 = "$giornopub-$mesepub-$annopub"; $datapub = "$annopub-$mesepub-$giornopub"; $datafine1 = "$giornofinepub-$mesefinepub-$annofinepub"; $datafine = "$annofinepub-$mesefinepub-$giornofinepub"; $pubblicazione = "$annopub"; $pubblicazione .= "$numreg"; $pubblicazione .= "$fileallegato_name"; echo "

Pubblicazione n. $numreg Anno $annopub


"; echo " Data inizio:$datapub1
"; echo " Data fine:$datafine1
"; echo " File origine: $fileallegato_name
"; echo " File destinazione: $pubblicazione
"; echo " File origine tmp: $fileallegato_tmp
"; $nome_tabella = $db_pubmat; $isql = "INSERT INTO $nome_tabella(ANNO, NUMREG, SPOSO, SPOSA, DATAINIZIO, DATAFINE, ALLEGATO) "; $isql .= "VALUES("; $isql .= "'" . $annopub . "', "; $isql .= "'" . $numreg . "', "; $isql .= "'" . addslashes($sposo) . "', "; $isql .= "'" . addslashes($sposa) . "', "; $isql .= "'" . $datapub . "', "; $isql .= "'" . $datafine . "', "; $isql .= "'" . $pubblicazione . "')"; $DB =mysql_select_db($db_nome, $connessione) or die("Impossibile aprire il database 'mysql(err)'"); $risultato = mysql_query($isql,$connessione) or die(mysql_error()); #copia immagine echo "
Verifica allegato"; if ($fileallegato_name !="") { echo "
Inizio connessione FTP"; // stabilire una connessione #$ftp_server =$ftpserver; #$ftp_user_name = $ftpuser; #$ftp_user_pass = $ftppassw; $conn_id = ftp_connect($ftp_server); // login con user name e password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // turn passive mode on ftp_pasv($ftp_conn, true); // controllo della connessione if ((!$conn_id) || (!$login_result)) { echo "La connessione FTP è fallita!"; echo "Tentativo di connessione a $ftp_server per l'utente $ftp_user_name"; die; } else { echo "
Connesso a $ftp_server, utente $ftp_user_name"; } $destination_file = "/pubblicazioni/$pubblicazione"; $source_file = "$fileallegato_tmp"; #$source_file ="C:\1\1.pdf"; // upload del file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); echo "
Copia $source_file su $destination_file"; // controllo dello stato di upload if (!$upload) { echo "
Il caricamento FTP non è andato a buon fine!!!"; } // chiudere il flusso FTP ftp_quit($conn_id); } $ELENCOTAB .= "

"; } echo "$ELENCOTAB"; ?>