//DADOS PARA CONEXÃO $server = "ftp.vanessaluiza.com"; $usuario = "vanessal"; $senha = "400272272004v"; //VERIFICA SE O FORM FOI ENVIADO PARA CONECTAR E ENVIAR O ARQUIVO AO FTP if($_POST) { //RECEBE O ARQUIVO $arqName = $_FILES[arquivo][name]; $arqTemp = $_FILES[arquivo][tmp_name]; //CONECTA AO FTP $conn = ftp_connect($server) or die ("ERRO AO CONECTAR AO SERVIDOR DE FTP ".$server); //TENTA EFETUAR O LOGIN COM USUÁRIO E SENHA DE ACESSO if(@ftp_login($conn, $usuario, $senha) ) { //ENVIA O ARQUIVO $status = ftp_put($conn, "/public_html/".$arqName, $arqTemp, FTP_BINARY); //VERIFICA SE O ARQUIVO FOI ENVIADO if($status) { echo "O arquivo $arqName foi enviado com Sucesso!"; }//FECHA IF ( status ) else { echo "Erro! Aconteceu algum problema no envio do arquivo."; }//FECHA ELSE }//FECHA IF (LOGIN) else { echo "Não foi possível efetuar a conexão. Verifique o usuário e a senha de acesso."; }//FECHA ELSE //TERMINA A EXECUÇÃO die; }//FECHA IF ( POST ) ?>
Com carinho,
Vanessa❤
invit.com.br