***SOLVED*** Contact form

Issues related to forms.
Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 15, 2020 12:36 pm

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: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 15, 2020 12:38 pm

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.

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 15, 2020 12:57 pm

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: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 15, 2020 1:09 pm

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.

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 15, 2020 2:43 pm

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: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 15, 2020 2:46 pm

If you need further assistance then please share a demo project so I can see all your settings.

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 15, 2020 3:00 pm


User avatar
Pablo
 
Posts: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 15, 2020 3:21 pm

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.

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 22, 2020 8:15 am

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: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 22, 2020 9:09 am

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.

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 22, 2020 9:45 am

Ok...now create database...
Now can connect to SMPT?

User avatar
Pablo
 
Posts: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 22, 2020 10:00 am

Yes, SMTP will also work with the correct settings.

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

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 22, 2020 10:20 am

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: 21507
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Contact form

Post by Pablo » Tue Sep 22, 2020 10:30 am

Does your wamp server have a SMTP server?

Dragos
 
 
Posts: 70
Joined: Tue Sep 04, 2018 7:08 am

Re: Contact form

Post by Dragos » Tue Sep 22, 2020 10:35 am

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

Post Reply