Contact Form Not working

15 replies · opened May 31, 2021

EeRealtyMarketingMay 31, 2021

Hi I set up form.php as indicated in the documentation but since the domain of my client is using Hostgator as web host and Google Workspace as email host I think that may be the cause of the issue.

When I press SEND there's an infinite spin loop and the form it's not working.
You can see the config I did below:

$mail = new PHPMailer(); // with true in the parenthesis

/* Add your SMTP Codes after this Line */
$mail->SMTPDebug = '0';
$mail->isSMTP();
$mail->SMTPAuth = 'true';
$mail->Host = 'smtp.gmail.com';
$mail->Username = 'liaarmindamontenegro@gmail.com';
$mail->Password = '2220Branca4957';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';

SSemicolon WebSTAFFMay 31, 2021

Hello,

We have just checked out your Website and the Form Processor: https://okeefe.com.ar/blanqueo/include/form.php is returning a 500 Internal Server Error which is an indication that there is a Server Configuration issue.

Firstly, please make sure that your PHP Version is more than 5.6 or preferably the Latest Version.

If you are still facing further issues, the please consider adding the .customjs Class to the .form-widget Element in the HTML File and then following code at the very top of your include/form.php File:
[ch_pre type="php"]error_reporting(E_ALL);[/ch_pre]

which should display all the possible errors. Please notify us about the Error Message you see, after going through the process above, so that we can provide you with more assistance on this. Thanks for your Patience!

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

EeRealtyMarketingMay 31, 2021

Hi thanks my PHP version is 7.3.28

I paste this line: error_reporting(E_ALL); at the top of the form.php before I made this consult

But I think I didn't do well aout this...:
"the please consider adding the .customjs Class to the .form-widget Element in the HTML"

Could you please send me an example how should this look like.
Cause is showing me no error, also I don't see any Error 500, just an infinity loop spin.

Thank again

SSemicolon WebSTAFFMay 31, 2021

Hello,

Consider going to this Page directly: https://okeefe.com.ar/blanqueo/include/form.php . You will see a 500 Internal Server Error message here. This is an issue with your PHP Configuration settings or Hostgator blocking the PHPMailer script considering the fact that the URL: https://okeefe.com.ar/blanqueo/include/form.php is directly getting an error. Additionally, please make sure that include/phpmailer Folder and all the Files inside exists on your Servers. Other than that, if you are still facing further issues, it is recommended to contact your Web Hosting Provider directly and they will definitely fix this for you.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

EeRealtyMarketingMay 31, 2021

Hi I just talked with HostGator support and they assure me there is not block at all.

I double check my files a lot of times, there's maybe something that I'm missing.
It could be great if you can take a look. This is the FTP access

FTP Username: support@okeefe.com.ar
Password: support2021
FTP server: ftp.okeefe.com.ar
FTP & explicit FTPS port: 21

And I'm still no seeing the 500 Error just the button spinning...

EeRealtyMarketingMay 31, 2021

Guys,

Here is the response from HostGator support:

We do see the error 500 indeed. Thanks for sharing the full message with us however this does not tell what php settings your script requires. We won't be able to determine the settings that the form requires too since we are not the author of this script.

Here's what we see when checking the server's logs.
Mon May 31 15:26:17.535883 2021] [core:error] [pid 742243:tid 140302622684928] [client 113.21.65.191:50366] End of script output before headers: form.php, referer: https://okeefe.com.ar/blanqueo/

It does appear to be related to php settings and we would recommend to ask the author of this script what php settings does this form need to function properly.

Could you please send me the detailed setting that the server must have to work properly it will be great.

SSemicolon WebSTAFFJun 1, 2021

Hello,

Thanks for your Patience!

There are no special PHP Settings required for the PHPMailer to run. Unfortunately, Hostgator is not completely honest with you. If you search Hostgator PHPmailer on Google, you will find many articles regarding this. Also, we have checked out your include/form.php File just now using FTP and now magically it is working fine. Try submitting your Form again: https://okeefe.com.ar/blanqueo/ .

Additionally, there are many HTML Validation errors on your Page: https://validator.w3.org/nu/?doc=https%3A%2F%2Fokeefe.com.ar%2Fblanqueo%2F which can cause unexpected issues. So please consider fixing these.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

EeRealtyMarketingJun 1, 2021

Hi! yes its working now

im gonna fix the validation.

Thank you I was a little bit desperate about this.

EeRealtyMarketingJun 1, 2021

I forgot oone more thing how can i make after submit go to a thank you page?

SSemicolon WebSTAFFJun 1, 2021

No Problem at all. We are very Happy to Help! :)

Make sure that the data-redirect Attribute is added to the .form-widget DIV. Example:
[ch_pre][/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

EeRealtyMarketingJun 2, 2021

Hi thank you, I did it, but its not working.

Could you please check if there's something missing??

SSemicolon WebSTAFFJun 2, 2021

Hello,

Remove the .customjs Class from the .form-widget DIV.

This should fix the issue automatically. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

EeRealtyMarketingJun 2, 2021

Hi I did it and is showing this:

{ "alert": "success", "message": "We have successfully received your Message and will get Back to you as soon as possible." }

SSemicolon WebSTAFFJun 3, 2021

Hello,

We can still see the .customjs Class on the .form-widget DIV and also the data-redirect Attribute placed wrongly on the .form-result DIV (see attached). Make sure that you are completely following the code samples provided above and review the codes closely before pasting it or rectifying it in your HTML Files to avoid any unnecessary issues.

Here is what your code should look like:
[ch_pre][/ch_pre]

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

EeRealtyMarketingJul 12, 2021

Hi How are you? after your instructions my form was working just fine, showing the ThankYou page correctly, but recently stopped working again.... Could you please check it out?

Also I started to use a CRM platform and I would like to add the new contacts to that system, they gave me the source code example to do it but since this form is not working properly since the beginning I prefer to check it with you guys.

The source code they gave is this:

Contact Form
Contact form & Landings

SUGGEST EDITS
STEP 1: Create the form in HTML
HTML

<div id="landingForm">
<div class="titulo2">CONTACTO</div>
<div><label>Name:</label><input type="text" id="name"/></div>
<div><label>Phone:</label><input type="text" id="phone"/></div>
<div><label>Cellphone:</label><input type="text" id="cellphone"/></div>
<div><label>Email:</label><input type="text" id="email"/></div>
<div><label>Message:</label><textarea id="message"></textarea></div>
<input type="button" onclick="send()" value="SEND"></div>
</div>

STEP 2: Javascript Send () function
JavaScript

<script>
function validate_mail(mail){
var filter = /[\w-.]{1,}@([\w-]{1,}.)*([\w-]{1,}.)[\w-]{2,4}/;
return filter.test(mail)
}

function send(){
if(validate_mail($("#email").val())){
data = { 'name':$("#name").val(),
'email':$("#email").val(),
'phone': $("#phone").val(),
'cellphone': $("#cellphone").val(),
'message': $("#message").val()
}
jqxhr = $.ajax({'url':"./sendContact.php", 'type': "POST", 'data':data })
.done(function(){
$("#landingForm").html("<span>Success</span>")
});
}
}
</script>
This function sends contact data to sendContact.php by ajax when user clicks SUBMIT form button
STEP 3: Create sendContact.php
Copy paste this code and change the TokkoAuth with your actual state APIKEY

PHP

<?php
include 'api.inc';

//CHANGE THIS APIKEY WITH YOUR REAL STATE APIKEY
$auth = new TokkoAuth('5940ea45eb7cfb55228bec0b958ea9c0be151757');

$data = array(
'text' => $_REQUEST['message'] ,
'name' => $_REQUEST['name'],
'email' => $_REQUEST['email'],
'cellphone' => $_REQUEST['cellphone'],
'phone' => $_REQUEST['phone'],
'tags' => array('mysite.com','my first landing','google'),
);

//Send Tokko property ID as 'property' if you wish send a specific property
if ($_REQUEST['property']){
$data['properties'] = array($_REQUEST['property']);
}

//Send Tokko development ID as 'development' if you wish send a development
if($_REQUEST['development']){
$data['developments'] = array($_REQUEST['development']);
}

$webcontact = new TokkoWebContact($auth, $data);
$response = $webcontact->send();
?>

SSemicolon WebSTAFFJul 13, 2021

Hello,

Hope you are doing well.

There are still quite a few Validation errors on your Page: https://validator.w3.org/nu/?doc=https%3A%2F%2Fokeefe.com.ar%2Fblanqueo%2F . Please fix them and check the issues again.

Additionally, we can see many JS errors in the Browser Console which might be causing this issue. We recommend updating to the Latest Version of Canvas to avoid unnecessary issues, as we periodically release updates to fix any JS Issues with the core files.

Unfortunately, regarding the CRM Platform, we wouldn't be able to help you out with this as we currently do not provide Customization related Support according to the Item Support Policy: https://themeforest.net/page/item_support_policy . You will need to manually code this or Hire a Freelancer to help you out.

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard