On php 7.3 or 7.4 the form works fine but on php 8 or 8.1, 8.2 it gets errors.
It was not the issue with hostinger. I tested using xammp php 8.2.4 the same errors came. So I think it has to be something related to php.ini config I think. I have given the project file and also the php.ini file. I tested it with both online mysql and even xammp localhost.
Note that the first time the form will submit correctly but when the second time the form again gets submitted the Uncaught mysqli_sql_exception: Duplicate column name 'FORMID'
There are other issues which I have written in the notes in the project file.
here are the files
https://temp-file.org/NlP6dn5dkuKoCl2/file
Having problems with form on higher php version
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
- wwonderfull
-
- Posts: 1558
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Having problems with form on higher php version
I do not see any issues in form.
This sounds like a database configuration issue.
Maybe you have accidentally set the formid field of the MYSQL table as primary key?
Or maybe the 'formid' field exists twice?
This sounds like a database configuration issue.
Maybe you have accidentally set the formid field of the MYSQL table as primary key?
Or maybe the 'formid' field exists twice?
- wwonderfull
-
- Posts: 1558
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Having problems with form on higher php version
As I said the form works fine in php 7.3 or 7.4 no errors everything is fine.
No. Everything is done automatically nothing in the mysql database is configured. All is done automatically when the form submits the columns get created the primary key is IDMaybe you have accidentally set the formid field of the MYSQL table as primary key?
dbtest InnoDB utf8mb4_general_ci 16.0 KiB
# Name Type Collation Attributes Null Default Comments Extra Action
1 ID (P_KEY) int(9) No None AUTO_INCREMENT Change Change Drop Drop
2 DATESTAMP date Yes NULL Change Change Drop Drop
3 TIME varchar(8) utf8mb4_general_ci Yes NULL Change Change Drop Drop
4 IP varchar(15) utf8mb4_general_ci Yes NULL Change Change Drop Drop
5 BROWSER tinytext utf8mb4_general_ci Yes NULL Change Change Drop Drop
6 FORMID varchar(255) utf8mb4_general_ci Yes NULL Change Change Drop Drop
7 NAME varchar(255) utf8mb4_general_ci Yes NULL Change Change Drop Drop
8 EMAIL varchar(255) utf8mb4_general_ci Yes NULL Change Change Drop Drop
9 MESSAGE varchar(255) utf8mb4_general_ci Yes NULL Change Change Drop Drop
As I had said previously the first time the form will submit correctly but when the second time the form again gets submitted the Uncaught mysqli_sql_exception: Duplicate column name 'FORMID'. I think that means on php 8 they dont let the FORMID loop happen because it already exists so no need to create or place the same column it again.Or maybe the 'formid' field exists twice?
The error encountering is due to the attempt to add a duplicate column name 'FORMID' to the MySQL table. It seems that the 'FORMID' column is already present in the table because on every submit the form trys to create already created column again like replacing, and the code is trying to add it again, leading to the duplicate column error.
In the provided code, the 'FORMID' column is not explicitly added through the loop that processes form data. Instead, it seems to be added implicitly with the other form field names. Since the 'FORMID' key is part of the $_POST array, it is processed in the loop with other form fields, causing the error.
I think the script needs to be edited for a better compatibility for php 8, because php 7 did not have these issues.
Re: Having problems with form on higher php version
What difference does that make?Instead, it seems to be added implicitly with the other form field names.
Why do you think that? It's just a form field like all others!Since the 'FORMID' key is part of the $_POST array, it is processed in the loop with other form fields, causing the error.
- wwonderfull
-
- Posts: 1558
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Having problems with form on higher php version
Running out of reasons why it is happening. A form which perfectly works on php 7 why doesn't it work on php 8. No settings are changed. The script is fine as long as it is having problem with the php configuration I guess.
how did the form work for you @pablo did you use mysql database with attachment and smtp meaning all in all? Did the success page show on php 8.2? Did you use the php.ini file I provided? Do I need to configure it again with any changes?
how did the form work for you @pablo did you use mysql database with attachment and smtp meaning all in all? Did the success page show on php 8.2? Did you use the php.ini file I provided? Do I need to configure it again with any changes?
Re: Having problems with form on higher php version
Your form works for me with php 8.x. The file is uploaded and the entry in the databases is created. It works multiple times. No errors.
Obviously I had to change the STMP and MySQL settings to make it work for me.
I have tested it on 2 different hosting servers: strato.com (PHP 8.1) and ionos.com(PHP 8.2)
I did not use your php.ini, because that does not work on my webhost.
I really do not understand the message 'Uncaught mysqli_sql_exception: Duplicate column name 'FORMID'
message because there is only one Form ID in the form.
To me this sounds like there is an issue on the server side.
Update:
I have found this related information: https://php.watch/versions/8.1/mysqli-error-mode
So, you can try to add this code via Page HTML (start of page)
Obviously I had to change the STMP and MySQL settings to make it work for me.
I have tested it on 2 different hosting servers: strato.com (PHP 8.1) and ionos.com(PHP 8.2)
I did not use your php.ini, because that does not work on my webhost.
I really do not understand the message 'Uncaught mysqli_sql_exception: Duplicate column name 'FORMID'
message because there is only one Form ID in the form.
To me this sounds like there is an issue on the server side.
Update:
I have found this related information: https://php.watch/versions/8.1/mysqli-error-mode
So, you can try to add this code via Page HTML (start of page)
Code: Select all
<?php
mysqli_report(MYSQLI_REPORT_OFF);
?>
- wwonderfull
-
- Posts: 1558
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Having problems with form on higher php version
That did not work. But guess what, I got to know what is the reason of the error
I tested for a long time checking unchecking many things to be more exact.
PHP 8.0 Hostinger
The database gets the data and I even get the email
All the reason of the problem is because of the file upload. I unchecked [X] UPLOAD FILES TO FOLDER ON THE SERVER and everything is fine. So this seems to be the problem nothing else. But I do want to use this feature as I want to upload my files on a folder on the server. But I will get that error if I do. I hope there can be a fix for it.
My upload folders name was uploads_mysitename and the file size was 22000 meaning 22MB that's all I had on options

PHP 8.0 Hostinger
The database gets the data and I even get the email
All the reason of the problem is because of the file upload. I unchecked [X] UPLOAD FILES TO FOLDER ON THE SERVER and everything is fine. So this seems to be the problem nothing else. But I do want to use this feature as I want to upload my files on a folder on the server. But I will get that error if I do. I hope there can be a fix for it.
My upload folders name was uploads_mysitename and the file size was 22000 meaning 22MB that's all I had on options
Re: Having problems with form on higher php version
For me, your project also works with file uploads. I have tested yesterday almost all day on several different servers.
- wwonderfull
-
- Posts: 1558
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Having problems with form on higher php version
Latest update 18.3.2 fixed everything @pablo. The form now works on every php version including PHP 8.2.4. I tested in xammp, hostinger all success. Marvelous solution you have provided

