Find Jobs
Hire Freelancers

Contact Form 7 Form File Upload to FTP Servers Based on Dropdown Selection -- 3

$10-30 USD

Concluído
Publicado há quase 7 anos

$10-30 USD

Pago na entrega
I have a simple request form setup in Contact Form 7 with a dropdown selection of two facilities. There are two anonymous server addresses to upload files to based on which dropdown facility is selected. I have successfully added the following code to the [login to view URL] file, tested it and it works correctly for one of the dropdown selections. My problem is, I cannot get the code right for the other dropdown selection to upload and work correctly. The setup is the form part goes to a distributed email address and the file gets uploaded to the Anaheim or Orange FTP server. ftp**.[login to view URL] – Orange Facility ftp**.[login to view URL] – Anaheim Facility This only works for the Orange Facility. Now I can't seem to get the logic right for the 2nd code. I tried doing two separate functions (FacilityA and FacilityB) but I am stuck on how to take the "SelectAFacility" name and split it into 2 functions or write a conditional statement. Here is the code for the Contact Form 7: <label> Your Name (required) [text* your-name] </label> <label> Your Email (required) [email* your-email] </label> <label> Company [text your-company] </label> <label> Select A Facility </label> [select SelectAFacility "Anaheim|ftpuploadanaheim(at)[login to view URL] Orange|ftpuploadorange(at)[login to view URL]"] <label>Upload File [file your-file filetypes:pdf|txt|doc|docx|xls|xlsx|ppt|pptx|zip|tar|tgz|rar] </label> [submit "Send"] ______________________________________________________________________________________ Based on the dropdown selection, I tried to add a conditional statement to achieve this but it is not working and I need it done today. Here is the code with the conditional statement: function log_cf7($WPCF7_ContactForm) { $submission = WPCF7_Submission::get_instance(); $data = $submission->get_posted_data(); $uploadedFiles = $submission->uploaded_files(); $location = $data['SelectAFacility']; if (isset($uploadedFiles) && isset($uploadedFiles['your-file'])) { if ($location == 'Anaheim') { $ftp_server = "ftp**.[login to view URL]"; $ftp_username = "username A"; $ftp_userpass = "password B"; } elseif ($location == 'Orange') { $ftp_server = "ftp**.[login to view URL]"; $ftp_username = "username B"; $ftp_userpass = "password B"; } else { // do something exit(); } $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to server"); $login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass); $fileToUpload = $uploadedFiles['your-file']; $remotefile = $_FILES['your-file']['name']; if (ftp_put($ftp_conn, $remotefile, $fileToUpload, FTP_ASCII)) { //echo "Successfully uploaded $remotefile."; } else { // echo "Error uploading $fileToUpload."; } // close connection ftp_close($ftp_conn); } }
ID do Projeto: 14142514

Sobre o projeto

14 propostas
Projeto remoto
Ativo há 7 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
Hello. Thank you very much for taking time to read my proposal. I can help you with CF file upload. You can check my portfolio and reviews. We can discuss further details. Hopefully, both of us will be happy after the job is done. Best Regards.
$49 USD em 1 dia
5,0 (182 avaliações)
6,7
6,7
14 freelancers estão ofertando em média $28 USD for esse trabalho
Avatar do Usuário
Hello, Greetings from Avinav.. We are Software Development Company with extensive experience and have Skilled experts 45 Professionals around. We dedicate Team for any project as per the size of the Project. We are expertise in Mobile apps, Android, iPhone, Database dev, PHP, HTML, CSS technology and can provide you the developer you are looking for from our talented and expertise developers at effective cost. The developers can work on the xCode, Objective C, Java, PayPal api, WordPress, CMS, PHP, MySQL, Ajax, JavaScript, HTML & CSS. Kindly initiate project communication so we can discuss further also are excited to work ahead. Regards, Avinav
$30 USD em 1 dia
4,9 (118 avaliações)
6,9
6,9
Avatar do Usuário
Hi there! Did go through your Job Description and glad to share that I have experience in working with wordpress platform. I have more than four years of industry experience and have been the part of diverse industry verticals. I also have expertise with Magento,WordPress, PHP, PHP Scripting and CodeIgnitor along with Photoshop. So can help you with the design as well. Looking forward to your response.
$30 USD em 1 dia
5,0 (195 avaliações)
6,7
6,7
Avatar do Usuário
Hello , i'm quite new to freelancer.com and i want to build a reputation here. As a senior PHP programmer with over 5 years of experience, i can complete any jobs you need and a short amount of time. I also know other web developing languages like javascript, jQuery, SQL and frameworks like Wordpress, Drupal, Jenkins, etc because i currently work in this field. The main thing that interests me here is the rating. To build a successful profile here, i need good ratings and it's very hard to start from scratch. I can do the job you requested in short amount of time and the payment can be optional. This way i can get my good ratings and you can get your job done :) As for my strategy, I will pick several keywords which can be ranked up. They will be checked daily for their current rank and the gathered information will be stored in a public/shared Google spreadsheet. During this process I will check the top 5 ranks for each keyword and analyse their content, readability, etc. I look forward for any future collaboration. Have a great day!
$30 USD em 1 dia
4,9 (7 avaliações)
3,2
3,2
Avatar do Usuário
Dear Sir, Can you please share the URL of your existing website with where you are using the code so that i can check that. Note:- I always be available in US timings for providing my service. And i can ensure that the contact for implementation would be finished within the US working timings. Looking forward to your response. Regards, Vineet
$20 USD em 1 dia
5,0 (2 avaliações)
1,5
1,5

Sobre o cliente

Bandeira do(a) UNITED STATES
Bullhead City, United States
5,0
6
Método de pagamento verificado
Membro desde jan. 29, 2017

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.