Problems with the form

When some1 try to send me a mail from my web form they get this:

Warning : Undefined global variable $_SESSION in /www/ on line 42

Warning : Trying to access array offset on value of type null in /www/ on line 42

Error: SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

My form page in whebsite is this:

Line 42:

if (($POST[‘csrfToken’] == $_SESSION[‘fdyFormToken’]) && ($_POST[‘hc_value’] == ‘’)) {

Those are warning are being displayed because your PHP setup has Display Warnings and Errors enabled in your PHP settings on your server. You’ll want to consult your host’s documentation on how to turn that off your your server’s PHP settings.

As for the SMTP error – That would likely be because you’ve not used the proper server or credentials, or both, for your SMTP server. Again, you’ll want to consult your host’s SMTP server setup configuration for this.

1 Like

Gonna contact them right now and if its ok for you, gonna share the solution once i achieve it if you leave the topic open.

No need to share the solution really since it will be specific to your server but you’re welcome to if you really want to. You should be able to find your answers though in your host’s documentation.

“The alerts that you indicate in the screenshot indicate that there is a global variable which is being invoked but is not defined which is &_SESSION and the code in turn is trying to access an array (array) of type null. Both errors are development errors, so we suggest that you verify it with a web developer”

They are right and I was not really sure when u reply me. But the problem here is not the alerts and errores from my provider, the problem here is the code where i have a $ not declared and an array of type null into the php file.

Sry, “…” is the response of my hosting provider after fixing smtp server settings.


The problem with those 2 warnings was the version of PHP running on my hosting provider and the one which the form use. The form runs 5.x … a really old one. So, I downgrade to 5.x and solved. Thanks for the help!

I’m running the F3 Form on multiple PHP 8.1 servers, all running flawlessly.

1 Like

Mine was running on PHP 8.2

Using Foundry 3?

I honestly don’t think PHP 5 is the answer here. It’s so old, you’ll be opening up a whole new can of worms!

Already change it to 8.1 and it goes flaweless as u say. The problem was the 8.2

1 Like

I’ll take a look when I’m back to the office Monday, but I believe it should work in PHP v8.2 as well. That said, you should definitely not be running PHP v5. I’ll mark this as solved for now though.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.