***SOLVED*** Contact form

Issues related to forms.
Post Reply
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

***SOLVED*** Contact form

Post 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
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

Did you create the database table?
Does it have the correct fields?
What exactly did you do?
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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?
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

You create the database and table on the server via PHP Admin.
The structure depends on the fields on your form.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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 ?
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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
MGD4me
 
 
Posts: 288
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

Re: Contact form

Post 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.
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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.
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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...
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

Are there any errors?
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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.
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos »

Just what i say....in my wamp server php error are enable for all errors....is blank...nothing in php_error.log
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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...
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

If you need further assistance then please share a demo project so I can see all your settings.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos »

User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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']);
}
}
}
}
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post 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.
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos »

Ok...now create database...
Now can connect to SMPT?
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

Yes, SMTP will also work with the correct settings.

Note that these settings are for local SMTP (on the same server).
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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
User avatar
Pablo
 
Posts: 21712
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo »

Does your wamp server have a SMTP server?
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post 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
User avatar
Dragos
 
 
Posts: 217
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos »

Thank You very much and sorry for your time...my mistake...in mail server configuration
Post Reply