Need help with form code

Hi, i have created several landings pages at WebFlow, but I have some questions about the forms to send at contact forms with a send.php file.

Currently I have a fairly simple code but does not work properly on all hostings, maybe some firewall is blocking. I’m not expert in php.

Implement this code in my landings:

<?php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$msg = $_POST['msg'];
$subject = 'Contact Landing';
$from = "From:contact@website.cl";

$message = "Name: " . $name . " \r\n";
$message .= "Phone: " . $phone . " \r\n";
$message .= "E-mail: " . $email . " \r\n";	
$message .= "Send " . date('d/m/Y', time()) . " \r\n";
$message .= "Message: " . $msg . "\r\n";
$message .= "\r\nContact from" . $subject . "";
$for = 'contact@website.cl';

mail($for, $subject, utf8_decode($message), $from);    
echo "<script>window.location = 'thanks.html'</script>";
?>

How I can successfully deploy a file/method to send emails the forms designed at WebFlow?
Does the system validation of forms at WebFlow I still work with this method? Because I tried at iphone and messages can be sent with empty fields.

Sorry if I did not explain well, use google translate.

Thanks.

Hi @danieltusclicks, are you just trying to make a form created in Webflow to work on your server so that your own PHP file gets called? If so, all you need to do, is in the Form settings in Webflow, just setup an Action property that points to the PHP file on your own server that will process the form fields. You will need to set the Method property of the form to GET or POST. Now once you have done that, your own PHP file will be responsible for mail sending or saving data to some database etc.

Is there a reason, you want to use your own form processor over the automatic form handling in Webflow?

The following help topic describes the situations when exporting forms from Webflow I would check your settings in your exported html and then check the situation again and let us know.

Best regards, Dave

Hi @cyberdave , yes, in fact I’m currently using this on all my pages designed in WebFlow and everything works fine, except in Iphones that can send data with empty fields.

The reason I use this php file on my landing pages its because I’m using those pages with my clients Adwords campaigns and my current plan have a certain limit inputs for forms and in some cases came to pass that limit.

But now my real problem is on iphones that can send data with empty fields.

Thanks!

Hi @danieltusclicks, can you share your site url, where you have the exported files installed? I can go take a look how you have the form setup in those exported files… Cheers, Dave

For example to enter this site from iphone can send empty fields, but android does not let you send if they are empty. I currently hosted on the server of the client, but I can send you if you need it.

http://institutocompetent.com/competent/

Thanks!