Page 1 of 1

Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 6:38 am
by tanik.sam
I've tied to use the tutorial on http://www.wysiwygwebbuilder.com/forms_php.html in order to make my form send the messages on my mail. But I have nothing on my mail. I see, that my form (when I press submit) connect to feedback.php (I see answer). I know that the webserver of my hoster supports PHP.

The php code (generated automatically by WYSIWYG WB15):
<?php
$mailto = "tanik.sam@yandex.ru";
$subject = "Feedback form";
$message = "Values submitted from web site form:";
$header = "From: ".$_POST['email'];
foreach ($_POST as $key => $value)
{
if (!is_array($value))
{
$message .= "\n".$key." : ".$value;
}
else
{
foreach ($_POST[$key] as $itemvalue)
{
$message .= "\n".$key." : ".$itemvalue;
}
}
}
mail($mailto, $subject, stripslashes($message), $header);
?>

The fuL\ll code of the page with expention .php (generated automatically by WYSIWYG WB15):
<?php
$mailto = "tanik.sam@yandex.ru";
$subject = "Feedback form";
$message = "Values submitted from web site form:";
$header = "From: ".$_POST['email'];
foreach ($_POST as $key => $value)
{
if (!is_array($value))
{
$message .= "\n".$key." : ".$value;
}
else
{
foreach ($_POST[$key] as $itemvalue)
{
$message .= "\n".$key." : ".$itemvalue;
}
}
}
mail($mailto, $subject, stripslashes($message), $header);
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Feedback</title>
<meta name="keywords" content="сельхозтехника, запчасти">
<meta name="author" content="Агротика">
<meta name="generator" content="WYSIWYG Web Builder 15 - http://www.wysiwygwebbuilder.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="css/Site_Agrotika2.css" rel="stylesheet">
<link href="css/feedback.css" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
<script src="wwb15.min.js"></script>
<script>
$(document).ready(function()
{
$('#wb_Text1').addClass('visibility-hidden');
function onScrollText1()
{
var $obj = $("#wb_Text1");
if (!$obj.hasClass("in-viewport") && $obj.inViewPort(true))
{
$obj.addClass("in-viewport");
AnimateCss('wb_Text1', 'transform-scale-in', 100, 2000);
}
else
if ($obj.hasClass("in-viewport") && !$obj.inViewPort(true))
{
$obj.removeClass("in-viewport");
AnimateCss('wb_Text1', 'animate-fade-out', 0, 0);
}
}
if (!$('#wb_Text1').inViewPort(true))
{
$('#wb_Text1').addClass("in-viewport");
}
onScrollText1();
$(window).scroll(function(event)
{
onScrollText1();
});
});
</script>
<meta name="yandex-verification" content="36fc8eb91d7a48a1" />
</head>
<body>
<div id="space"><br></div>
<div id="container">
</div>
<div id="wb_LayoutGrid1">
<div id="LayoutGrid1">
<div class="row">
<div class="col-1">
<div id="wb_Text1">
<span style="color:#FFFFFF;font-family:Arial;font-size:29px;">Ваше сообщение отправлено</span>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Where is the mistake?
Thanks for any idea.

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 7:08 am
by Pablo
First please note that this tutorial is for advanced users who want to implement their own script.
So, some knowledge of PHP is required.

If you are not an advanced user then it may be better to use the built-in script instead.
https://www.wysiwygwebbuilder.com/forms.html

If that still does not work then please read "Emails are not arriving in my inbox" in the FAQ:
http://www.wysiwygwebbuilder.com/forum/ ... 10&t=32967

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 8:12 am
by tanik.sam
Pablo wrote: Fri Jul 24, 2020 7:08 am First please note that this tutorial is...
Thank you for your quick unswer.
I'va made according to your recommendation (by using built-in PHP form processor), and there is success when I use the form on PC. But there is still no mail when I use android smartphone. Could you give me one more idea about this problem. Thank you in advance.

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 9:12 am
by Pablo
Did you read the FAQ?
Did you contact your web host to ask why they do not send the email?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 9:26 am
by tanik.sam
Yes,but I've not found information about difference between PC and smartphones. The problem just with one smartphone, I reseive the error-message, while on other devices (including other smartphones) it operates correctly. The error: "The specified email adress(tanik.sam@yandex.ru) is invalid." But it valid, of course, and i get mail from form on other devices.

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 9:30 am
by Pablo
What is the exact error?
What is the URL of the form?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 9:58 am
by tanik.sam
I know the name of error because on error page in text there is an inscription ##error##
http://agrotika.by/about.html - it is a page where is a button ("envelope") in the left top of page. The form disscussed opens in lightbox.

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 12:12 pm
by Pablo
What is the error message?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 12:19 pm
by tanik.sam
The error message - the message which writen on page in case of error, including inscription ##error##. Namely- "The specified email adress(tanik.sam@yandex.ru) is invalid."

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 12:59 pm
by Pablo
It seems to work correct for me.
Did you enter a valid email address?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 1:34 pm
by tanik.sam
Thank you for your answers. As far as I've checked ( i've cheked pocofone p1,xiaomi mi a2 lite, lenovo a 5000, and samsung s9+, s10+ and PC), the problem is on samsung s9+ and samsung s10+.Have you faced similar situation?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 1:51 pm
by Pablo
The emails are sent by the server, so the browser should not have any impact on whether or not the form works.

Maybe the browser blocks sending the email to the server address for privacy reasons?

Re: Using PHP to collect Form data doesn't work

Posted: Fri Jul 24, 2020 3:38 pm
by tanik.sam
Thank you for your advices very much! if i find the decision of problem with samsung smartphones, i'll write.

Re: Using PHP to collect Form data doesn't work

Posted: Mon Jul 27, 2020 5:38 am
by tanik.sam
Hi! The problem with samsung dissapears when I imput e-mail in form manually. It doesn't depend on brouser (i tried three different brousers on samsung) Of course, it is uncomfortable for user. Did anybody face this problem? What was the decision?

Re: Using PHP to collect Form data doesn't work

Posted: Mon Jul 27, 2020 7:22 am
by Pablo
The problem with samsung dissapears when I imput e-mail in form manually.
What do you mean by this?

I have never heard about any issues with Samsung devices and email input.
WWB uses standard HTML elements. The software has no control over the behavior of input fields on browsers. It's standard HTML functionality.

Re: Using PHP to collect Form data doesn't work

Posted: Mon Jul 27, 2020 7:39 am
by tanik.sam
I mean Samsung keyboard: if I type e-mail adress in form manually (without usage of ccookie-email-adress which appears as prompt in the top of keyboard) - all works perfectly. The same if I paste previously copied e-mail adress. But if I use prompt from cookie (wich appears in the top of keyboard when I start typing) - I have the mistake and my message is not send.

Re: Using PHP to collect Form data doesn't work

Posted: Mon Jul 27, 2020 8:15 am
by Pablo
This should not make a difference. But if it does then it's a bug in the browser.

Re: Using PHP to collect Form data doesn't work

Posted: Mon Jul 27, 2020 8:18 am
by tanik.sam
Exactly it is not the bug of brauser, because i have the same situation when use chrome and mozilla. It is rather the bug of samsung keyboard.
Thank you for your answers.