Having Trouble with Contact Form

7 replies · opened Jul 2, 2022

LleriksenJul 2, 2022

I'm having trouble with the contact form on my website. I am using it in two places--the home page and on the contact us page. In both instances, when someone fills out the form it does not submit. It just goes into a spinner death-spiral. I am including the html files and the php file for the home page, contact us page. The only change I've made to the include/form.php is to add my email address and name where indicated. Please let me know if I am missing a key element to the code to make it work. I have had other .php forms work just fine in the past, so I'm not sure what is going on in this case.

/-------------------------------------------------
Receiver's Email
---------------------------------------------------
/

$toemails = array();

$toemails[] = array(
'email' => 'laurel@eriksenwebdesign.com', // Your Email Address
'name' => 'Laurel Eriksen' // Your Name
);

/-------------------------------------------------
Sender's Email
---------------------------------------------------
/

$fromemail = array(
'email' => 'no-reply@pacificforge.com', // Company's Email Address (preferably currently used Domain Name)
'name' => 'Pacific Forge' // Company Name
);

SSemicolon WebSTAFFJul 2, 2022

Hello,

Since your Form File: include/form.php (http://www.pacificforge.com/include/form.php) is returning a 500 Internal Server Error, it is an indication that this is a Server Configuration issue.

Please consider adding the .customjs Class to the .form-widget DIV and then the following code at the very top of your include/form.php File just after the opening php tags:
[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 further 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.

LleriksenJul 2, 2022

I added the code and now instead of the form not submitting at all, it goes to a 500 error page. However, there are no other errors showing from the added code to the form.php page.

I just replaced a website that used php contact forms without issue. I'm not sure what's happening in this instance.

SSemicolon WebSTAFFJul 3, 2022

Hello,

Apologies for the Inconveniences caused!

We use PHPMailer for sending Emails which is the leading Secure PHP Email Processor, so everything should work fine out of the box. The Server Configurations here is what is causing the issues. Can you please let us know what Version of PHP you are using and also please add the following code at the top of the include/form.php File just after the starting <?php Tags:
[ch_pre type="php"]ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);[/ch_pre]

Then try opening the Page directly: http://www.pacificforge.com/include/form.php or simply let us know after updating the codes and we ca do further troubleshooting for you. 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.

LleriksenJul 3, 2022

This is the error code that comes up: Parse error: syntax error, unexpected '[' in /data/23/2/13/76/2176402/user/2389176/htdocs/include/phpmailer/src/PHPMailer.php on line 167

SSemicolon WebSTAFFJul 3, 2022

Hello,

Please make sure your Server's PHP Version is more than 5.6 or preferably the Latest Version. This will automatically fix the issue.

Hope this Helps!

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

LleriksenJul 3, 2022

I'll get the server information from the company on Tuesday. Once I have access to the server, what are the PHP settings I should be using?

SSemicolon WebSTAFFJul 4, 2022

Hello,

PHPMailer usually works with default settings. Except if you want to use SMTP, you will need it either to be enabled on your Servers or use a Mail Server with SMTP Access (Like Gmail, Mailgun or Sendgrid). There shouldn't be any issues even if you have the Default PHP Settings but preferably more than PHP 6, as PHPMailer is used very widely and even WordPress uses PHPMailer.

Hope this Helps!

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