I have created a self hostet form in Blocs. Everything is working fine. Now I wanted to modify the form.php file in the incluces folder. I expected that “return false” would show the fail message and “return true” would show the success message. So I changed the second last line in the form.php file from “return true” to “return false”. Strangely enough, I noticed no change in the behaviour of the form, i.e. the success message is displayed.
So my question is: What effect does “return false” have in the form.php file?
<?php
if (empty($_POST['name']) && strlen($_POST['name']) == 0 || empty($_POST['email']) && strlen($_POST['email']) == 0 || empty($_POST['message']) && strlen($_POST['message']) == 0)
{
return false;
}
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$to = 'info@xyz.com'; // Email submissions are sent to this email
// Create email
$email_subject = "Message from a Blocs website.";
$email_body = "You have received a new message. \n\n".
"Name: $name \nEmail: $email \nMessage: $message \n";
$headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";
$headers .= "From: info@xyz.com\r\n";
$headers .= "Reply-To: $email";
mail($to,$email_subject,$email_body,$headers); // Post message
return false; // was "return true" before
?>