Submit Forms and PHP

What version of PHP does bloc support for submitting form with contact information?
On PHP 8.0 I get the success message but don’t get the email. On PHP 8.1 I get the failed message and of course don’t get the email.

I think this is a server side issue as I have other contact forms that work. I have contacted my web server host two times but they did not provide any workable answer.

Blocs manual for forms

Any ideas?

Are you using an older version of Blocs 4? There was an issue with PHP 8 or above that was fixed with an update.

No I am using Blocs 5

Can you switch the version of php you are using to say PHP 7.4. What happens then?

Yes, I switched to 7.4 with this I get the failed message. I also get the failed message with 8.1 and 8.2. PHP 8.0 is the only version I get the success message.

I am talking with IONOS right now for the third time… no luck with then??

Did it ever work OK before?

Maybe the error logs in your hosting might shed some light on this (use the form then look at the logs time stamps you use the form)

Maybe do a clean upload of the full site incase some old php form files are still lingering there,

I know Blocs 5 works reliably for me with with various PHP versions, so I suspect the issue here is with the web host.

I also use IONOS with php 8.1 and all working fine.
I also used 7.4 and all was good then.

In that case I would suggest @eagle clears the contents on the server and upload the website from scratch. One way or another though Ionos should be able to test this. I only had one experience with them about 5 years ago on behalf of a client and we ended up moving the site to my server.

Here where this issue stands now.

Using Blocs 5.0.7. PHP 8.0
I have cleared the contents on the server, uploaded the website. Did not fix the problem
Created a new test website loaded it into a test subdomain of the website Test Highlandfence Company
This test site has two pages. Home page and contact page. On the home page it has one bloc with a code bric.
The code bric has the following code I got from IONOS

<?php

// THE BELOW LINE STATES THAT IF THE SUBMIT BUTTON
// WAS PUSHED, EXECUTE THE PHP CODE BELOW TO SEND THE
// MAIL. IF THE BUTTON WAS NOT PRESSED, SKIP TO THE CODE
// BELOW THE "else" STATEMENT (WHICH SHOWS THE FORM INSTEAD).
if ( isset ( $_POST [ 'buttonPressed' ] )){

// REPLACE THE LINE BELOW WITH YOUR E-MAIL ADDRESS.
$to = 'info@highlandfenceco.com' ;
$subject = 'From PHP contact page' ;

// NOT SUGGESTED TO CHANGE THESE VALUES
$message = $_POST [ "message" ] ;
$headers = 'From: ' . $_POST[ "from" ] . PHP_EOL ;
mail ( $to, $subject, $message, $headers ) ;

// THE TEXT IN QUOTES BELOW IS WHAT WILL BE
// DISPLAYED TO USERS AFTER SUBMITTING THE FORM.
echo "Your e-mail has been sent! You should receive a reply within 24 hours!" ;}

else{
?>
<form method= "post" action= "<?php echo $_SERVER [ 'PHP_SELF' ] ;?>" />
  <table>
    <tr>
      <td>Your e-mail address: </td>
      <td><input name= "from" type= "text"/></td>
    </tr>
    <tr>
      <td>Your message: </td>
      <td><textarea name= "message" cols= "20" rows= "6"></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td><input name= "buttonPressed" type= "submit" value= "Send E-mail!" /></td>
    </tr>
 </table>
</form> 
<?php } ?>

Using this code I get the email.
The contact page has just a form bric and when I submit the form I get the success message but do not get the email.
Also uploaded the same blocs project to the following URL Test Forms with the same result from the contact page. No email

Here is my test blocs project

MailTest.bloc.zip (15.1 KB)

Any ideas how to debug this further? Can I turn on a php debug log?

@Norm Would you please take a look at this issue, I am still having this pesky problem. With forms not being sent from a few of my websites. I feel sure this is something simple I might be missing but have not been able to resolve this. So, my blocs I am using is Blocs 5.0.7 on Ventura and my server is IONOS. The latest test is with the following website. No Drips Allowed
The form on the contact page works as expected.
So, I created a test page with a new forms bloc. The page is New Page. With PHP 8.1 I get the failed message when submitting the form and the success message when using PHP 8.0 but in any case no is received.

Next for testing I copied the form from the contact page (That works) and pasted it on the new Form page. So, this form that works on contact page does not work this new page.

I have talked with IONOS several time with no results.
Two questions
Any ideas you have to debug would greatly appreciated?
Can you share some details on what blocs does when the submit button on a form is pressed?

Thanks
Bob

@Bootsie

Would you mind given this blocs test project a try with IONOS. It has two pages. The home page has just a code bloc which contains a PHP mail script IONOS sent me to try and the second page has a contact form on it.

The first page works fine and the second page (the form) does not work, I get success message but never get the email.

I am using Blocs 5.0.7 and on IONOS php version is 8.0 and mail forwarding.

Just change the mail to what ever you would like in both the the code bric as well as the form bric where I have info@oakridgebr.org and let me know your results.

MailTest.bloc.zip (16.3 KB)

Unfortunately, I have the same problem, the message sender of other software makers works perfectly, but Blocs does not.
There are places where it works, there are places where it doesn’t.
There wasn’t such a problem a long time ago.

I uploaded your file on a test domain and the build-in form works like a charm.

1 Like

Thanks Jerry. :grinning:

1 Like

@eagle Today I got an e-mail from IONOS about a security breach in php settings.
Maybe you should check you messages on your Ionos account.
The breach has something to do with version 8x. They say they have fixed it but you should have a look at some settings.

@Boss81

Unfortunately, I have the same problem

Do you use IONOS or some other provider?

Just got off the phone with IONOS support, they say can’t help unless I pay $140 for scripting support. I thinking about moving, any recommendation for hosting providers?

Thanks

Personally, I don’t care for the way support has gone. Like Submit a Ticket… we’ll get back to you. Often they return in Code language I don’t understand. If… you’re able to get a human, then they are in a Country where you can’t understand them, or your call gets drop, for no reason. Oh yeah, you have to call back which took a long time to finally connect. :disappointed: Support has gone down a steep hill. I could go on but I am just expressing my frustration. Forgive me.

Does anyone have a friendly, U.S. based support (my suggestion) Host that will work for us the paying customer?

@Jerry Do you use IONOS, if not which one do you use?