Hey everyone, here is the 8th beta of Blocs V5.1. This build introduces support for the latest version of Bootstrap 5.3, some new controls for the dark/light Bootstrap Theme options and obviously more bug fixes.
I still have an old pre-existing form exporting like this:
<?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'];
$number = $_POST['number'];
$select_service = $_POST['select_service'];
$message = $_POST['message'];
$consent = $_POST['consent'];
// Create Message
$to = 'example@example.co.uk';
$email_subject = "Website Enquiry - Bedfordshire";
$email_body = "You have received a new message. \n\n Name: $name \nEmail: $email \nNumber: $number \nSelect_Service: $select_service \nMessage: $message \nConsent: $consent \n";
$headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";
$headers .= "From: example@gsh18.guru.net.uk\r\n";
$headers .= "Reply-To: DoNotReply@yoursite.com";
// Post Message
if (function_exists('mail'))
{
$result = mail($to,$email_subject,$email_body,$headers);
}
else // Mail() Disabled
{
$error = array("message" => "The php mail() function is not available on this server.");
header('Content-Type: application/json');
http_response_code(500);
echo json_encode($error);
}
?>
That same form is on a dozen pages and always says Bedfordshire despite having different subjects. Also notice the reply to entry, which is all wrong and the message saying php function is not available, which is flat out wrong. The same forms were working fine when last checked a few months back. N.B I know php is enabled on that server, because I have other sites and the emails come through.
I’ve tried SMTP again, but nothing has come arrived, so I’ll try switching back to PHP and see if anything works with this beta.
The email has come through using php, however the reply address is still listed as DoNotReply@yoursite.com. Here is the exported code and see it still says php is not available.
<?php
if (empty($_POST['name_33889']) && strlen($_POST['name_33889']) == 0 || empty($_POST['email_33889']) && strlen($_POST['email_33889']) == 0 || empty($_POST['message_33889']) && strlen($_POST['message_33889']) == 0)
{
return false;
}
$name_33889 = $_POST['name_33889'];
$email_33889 = $_POST['email_33889'];
$number_33889 = $_POST['number_33889'];
$select_service = $_POST['select_service'];
$message_33889 = $_POST['message_33889'];
$consent_33889 = $_POST['consent_33889'];
// Create Message
$to = 'example@example.co.uk';
$email_subject = "Website Enquiry - Home";
$email_body = "You have received a new message. \n\n Name_33889: $name_33889 \nEmail_33889: $email_33889 \nNumber_33889: $number_33889 \nSelect_Service: $select_service \nMessage_33889: $message_33889 \nConsent_33889: $consent_33889 \n";
$headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";
$headers .= "From: example@gsh18.guru.net.uk\r\n";
$headers .= "Reply-To: DoNotReply@yoursite.com";
// Post Message
if (function_exists('mail'))
{
$result = mail($to,$email_subject,$email_body,$headers);
}
else // Mail() Disabled
{
$error = array("message" => "The php mail() function is not available on this server.");
header('Content-Type: application/json');
http_response_code(500);
echo json_encode($error);
}
?>
It looks like nothing is coming through from the contact page either and that is php.
I’ll dig through and find each form, then send over a list.
Edit: Just run through them and sent over the list with a grand total of 32. It looks like there is an exported php file in the includes folder with no corresponding form from what I can tell.
Hey, @Norm
When I place three text links one below the other and add a top margin to all of them, it appears that the margin is not being applied to the last text link.
The newly added icon-link class works, but the focus-ring feature does not seem to be working as intended.
I replied to that just now, since that only relates to one issue and appears to override the subject if a form is duplicated.
There is the other problem with no reply email addresses, which appear in the php includes files and in one or two cases no php emails were arriving at all.
Also, is there a cache issue here? I am away from the computer but I think old forms are exporting different code vs the new ones.
I often have issues with forms when there is more than one form in the project. Like right now on my BB site the review form isn’t working. This wasn’t a duplicate form, they were both made separately.
Main contact form works fine. Usually if a re-export doesn’t work, I have to add a new form bric and drag in the fields from the non-working one and then it works fine
Updated the ticket. Some issues appear fixed, however the DoNotReply@yoursite.com bug is still there. I did another website recently using this beta with just one form and that was OK.
After comparing notes with @Brocky120, who shares the same web host, I’ve managed to get SMTP mail working and it wasn’t even necessary to enable outbound SMTP inside cPanel. There is one major weakness though with this setup and I wonder if the script can be tweaked?
At present, if an email comes through and I hit the reply button, it inserts the server address, rather than the address provided in the form by the site visitor. This really needs work like it would had php been used.