Page 1 of 1

***SOLVED*** Contact form

Posted: Mon Sep 14, 2020 12:34 pm
by Dragos
Contact form can't create database in MySql i use php 7.3.12 when i publish project...
https://workpage.ro/contact.php

Re: Contact form

Posted: Mon Sep 14, 2020 12:45 pm
by Pablo
Did you create the database table?
Does it have the correct fields?
What exactly did you do?

Re: Contact form

Posted: Mon Sep 14, 2020 1:28 pm
by Dragos
No i dont create....i hope contact form self create table...i create just data base...where i can find script for create the table?

Re: Contact form

Posted: Mon Sep 14, 2020 2:01 pm
by Pablo
You create the database and table on the server via PHP Admin.
The structure depends on the fields on your form.

Re: Contact form

Posted: Mon Sep 14, 2020 3:09 pm
by Dragos
I have the classic fields, name and surname, email and text.
I look to this video https://www.wysiwygwebbuilder.com/forum ... hp?t=78738, and i see is not necessary to create just a simple table but i cant save this without name like in the movie. The table is automatically populated after the publication of the site and the first email sent.
A classic table configuration script is nowhere to be found ?

Re: Contact form

Posted: Mon Sep 14, 2020 3:55 pm
by Pablo
To be able to help you I need more details.
What does your form look like?
What are your settings?
What is the generated PHP code?

Note that this is an advanced feature and some knowledge of MySQL is required.

Re: Contact form

Posted: Mon Sep 14, 2020 4:11 pm
by Dragos
Sir..nothing special..just connect to database and send email from smtp ...like in your block app wich have name email text and submit email...
smtp.php file here: https://drive.google.com/file/d/1T6Ssxv ... sp=sharing

Re: Contact form

Posted: Mon Sep 14, 2020 4:51 pm
by MGD4me
The necessary steps are fairly simple, but it does require some familiarity with databases, and phpMyadmin...

1. You need to manually create a database. Name it whatever you like.

2. Assign an existing user to this new database, or create a new user.

3. Create the form Table, inside this new database.

Now you have all the information required to configure the WWB form properties ('General' -> 'Advanced' -> 'MYSQL') : Server (localhost), Database, Table. User, and Password.

WWB will then be able to create all the data Fields, to match the names you assigned in your form. But, the database AND table must first be created by you.

Re: Contact form

Posted: Mon Sep 14, 2020 5:08 pm
by Pablo
Sir..nothing special..just connect to database and send email from smtp ...like in your block app wich have name email text and submit email...
The smtp.php file has nothing to with the database.
I advise you to do one thing at a time. So, first make 'email' work. And once you have that working continue with the configuration of the database.

See also MGD4me's message.

Re: Contact form

Posted: Mon Sep 14, 2020 5:27 pm
by Dragos
Thx all...but don't understand me.....create the table is the problem....anyway.....i try to find solution in other place...thx for your time....in facts i need an sql file with form table for standard form....nothing more....but will try to find into other place thx again all.

Re: Contact form

Posted: Mon Sep 14, 2020 5:36 pm
by Pablo
in facts i need an sql file with form table for standard form....
You do not need a sql file. The table structure is automatically created by the form script.
All you will have to do if create the database on the server and use the correct MySQL settings in the form's properties.
See also MGD4me's reply.

Re: Contact form

Posted: Mon Sep 14, 2020 5:57 pm
by Dragos
I created database for contact form, i give user privilege to acces total to database,,contact".... I set form with localhost, database name, table name user and pass, i set smtp with server, user, pass and authentification...required in port 25 and security none, but i cant create table because need names for fields....i publish my proiect but not connect to localhost and don't make a table...

Re: Contact form

Posted: Mon Sep 14, 2020 7:57 pm
by Pablo
Are there any errors?

Re: Contact form

Posted: Mon Sep 14, 2020 8:33 pm
by Dragos
Noi....your contact form is null in php 7.3.12....dont exist...with or without security ssl or tls or none...don't work without table...and don't make a table like v14 and V15...web...will try for few hours to fi back to downgrade php version in server and recreate the contact Page in wwb15.

Re: Contact form

Posted: Tue Sep 15, 2020 6:10 am
by Pablo
your contact form is null in php 7.3.12....dont exist
This indicates that there is an error.

Please enable PHP error reporting on the server or look in the PHP error log. This should give you a clue what is wrong.

Re: Contact form

Posted: Tue Sep 15, 2020 12:36 pm
by Dragos
Just what i say....in my wamp server php error are enable for all errors....is blank...nothing in php_error.log

Re: Contact form

Posted: Tue Sep 15, 2020 12:38 pm
by Pablo
This is very unusual.
The server should at least display an error when something is wrong.
I think something is wrong with the configuration of the server.

Re: Contact form

Posted: Tue Sep 15, 2020 12:57 pm
by Dragos
I have an error for other app in other folder...[15-Sep-2020 10:30:09 UTC] PHP Stack trace:
[15-Sep-2020 10:30:09 UTC] PHP 1. {main}() D:\wamp64\www\workpage\supportboard\include\ajax.php:0
[15-Sep-2020 10:30:09 UTC] PHP 2. sb_get_agent() D:\wamp64\www\workpage\supportboard\include\ajax.php:57
My public folder are workpage...in workpage folder are all my webpage....supportboard is other folder with chatbot app.
i try to create myself table for simple email database with ,,contact" db name and ,,form" table:
Can see here...but still not work...

https://drive.google.com/file/d/1zI02nq ... sp=sharing

Re: Contact form

Posted: Tue Sep 15, 2020 1:09 pm
by Pablo
If the table does not exist then it will be create be created by the script based on the form fields.
If the table already exists but is invalid then the script will fail.

Re: Contact form

Posted: Tue Sep 15, 2020 2:43 pm
by Dragos
Sir is just i say in my previous posts.....form cant create table....with fields...I give all rights to connect in data base but form cant do that...

Re: Contact form

Posted: Tue Sep 15, 2020 2:46 pm
by Pablo
If you need further assistance then please share a demo project so I can see all your settings.

Re: Contact form

Posted: Tue Sep 15, 2020 3:00 pm
by Dragos

Re: Contact form

Posted: Tue Sep 15, 2020 3:21 pm
by Pablo
Firstly , I do not understand why you have added custom code for re-captcha?
Why didn't you use the built-in re-captcha?

Also, as previously mentioned, I suggest do one thing at a time.
So, if you trying to make the database work, then do not use email or add other functionality until you have the database working.
You are only making it more difficult for yourself.

In other words:
- create a simple form. Remove everything else from the page.
- remove recaptcha from the form
- disable PHP mailer
- disable auto responder
- in the form's properties clear the 'email address' field.

Now you have a form with only database functionality.

Re: Contact form

Posted: Tue Sep 22, 2020 8:15 am
by Dragos
When i try to test online contact form i have this error in the page::
! ) Warning: mail(): SMTP server response: 530 SMTP authentication is required. in D:\wamp64\www\workpage\index.php on line 74
Call Stack
# Time Memory Function Location
1 0.0001 411168 {main}( ) ...\index.php:0
2 0.0003 411968 mail ( ) ...\index.php:74
Failed to insert data into table!
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`DATESTAMP`, `TIME`, `BROWSER`) VALUES ('2020-09-22', ' at line 1

This is the picture after sending email .. : https://drive.google.com/file/d/1jYVIeF ... sp=sharing
and this is project..https://drive.google.com/file/d/1Esh4m4 ... sp=sharing


$mail->AddReplyTo($mailfrom);
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
}
} THIS IS LINE 74
$mail->CharSet = 'ISO-8859-1';
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
if (is_array($_FILES[$key]['name']))
{
$count = count($_FILES[$key]['name']);
for ($file = 0; $file < $count; $file++)
{
$mail->AddAttachment($_FILES[$key]['tmp_name'][$file], $_FILES[$key]['name'][$file]);
}
}
else
{
$mail->AddAttachment($_FILES[$key]['tmp_name'], $_FILES[$key]['name']);
}
}
}
}

Re: Contact form

Posted: Tue Sep 22, 2020 9:09 am
by Pablo
When i try to test online contact form i have this error in the page::
! ) Warning: mail(): SMTP server response: 530 SMTP authentication is required. in D:\wamp64\www\workpage\index.php on line 74
This indicates that your smtp settings are incorrect.

Did you read my tips?
Why are you still using email if you are trying to make MySQL work?
Please disable all other functionality and instead focus on MySQL. Once you have that working you can enable all the other options.

Re: Contact form

Posted: Tue Sep 22, 2020 9:45 am
by Dragos
Ok...now create database...
Now can connect to SMPT?

Re: Contact form

Posted: Tue Sep 22, 2020 10:00 am
by Pablo
Yes, SMTP will also work with the correct settings.

Note that these settings are for local SMTP (on the same server).

Re: Contact form

Posted: Tue Sep 22, 2020 10:20 am
by Dragos
i do that but not working.....in wampserver i have database of hmailserver.....
first i try to set SMTP encryption : none, secound ssl and tls...
redirects me instantly to the error page

Re: Contact form

Posted: Tue Sep 22, 2020 10:30 am
by Pablo
Does your wamp server have a SMTP server?

Re: Contact form

Posted: Tue Sep 22, 2020 10:35 am
by Dragos
No....i have hmailserver and this soft database are in wamp..
I solved....is hmailserver problem...i set wrong security option connection on port 25.

https://www.hmailserver.com/ this is what i use like SMTP server

Re: Contact form

Posted: Tue Sep 22, 2020 10:45 am
by Dragos
Thank You very much and sorry for your time...my mistake...in mail server configuration