We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Hosting, Forms

Perch Forms App saves responses locally, but not on web server

Hello,

Submitting Form App's forms locally with XAMPP works. However, submitting the form live on the web server, form's input are not recorded in the database. This means, response entries appear, but not the data or actual input submitted.

As well, Form App's options on the web server seem can't 'read' form's fields. There is an 'Email address field' setting within Forms App, which works correctly locally – so that I can choose the according field, but the list doesn't show up when on the web server.

You may find the according form at http://martonlente.com/#contact-me

My web hosting provider sent me the following response on the issue:

I'm afraid I'm not familiar with Perch CMS, so there's little support I can offer here. I'm confident it's an issue with the script and not our service. There's no web server or PHP logs on our side that would indicate it's an issue with our server.

If there's a PHP script you can guide more towards that handles the form submitting I can take a look, but the contact page only calls the perch_content() function so I don't know where to look for further information regarding that.

The database itself is not storing the responses, so the issue is lying with the form handling. I would make sure your HTML is exact to your XAMPP install - if you change any field names (e.g. textboxes) then it may not be picked up by the PHP script. I would also recommend reviewing your PHP configuration - make sure your XAMPP install and your Arch Hosting account are on the same PHP version. Also check the PHP configuration (phpinfo()) and make sure everything important matches.

Of course my markup and databases I'm testing with are identical. What may cause the issue? Is there anything I should ask from my web hosting provider?

Let me paste my short diagnostic reports below.

Local, working (XAMPP):

Perch: 3.0.13, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.0.13), assets (3.0.13), categories (3.0.13), perch_forms (1.10), chirp_seo (1.2.1), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_mailchimp', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: E:\1708_personal-branding\31_Web\perch
PERCH_CORE: E:\1708_personal-branding\31_Web\perch\core
PERCH_RESFILEPATH: E:\1708_personal-branding\31_Web\perch\resources
Image manipulation: GD
PHP limits: Max upload 4M, Max POST 16M, Memory: 256M, Total max file upload: 4M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: martonlente.l1
DOCUMENT_ROOT: E:/1708_personal-branding/31_Web
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Web server, not working:

Perch: 3.0.13, PHP: 5.6.33, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, litespeed
Installed apps: content (3.0.13), assets (3.0.13), categories (3.0.13), perch_forms (1.10), chirp_seo (1.2.1), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_mailchimp', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home2/martonle/public_html/martonlente.com/perch
PERCH_CORE: /home2/martonle/public_html/martonlente.com/perch/core
PERCH_RESFILEPATH: /home2/martonle/public_html/martonlente.com/perch/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: martonlente.com
DOCUMENT_ROOT: /home2/martonle/public_html/martonlente.com
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Márton Lente

Márton Lente 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you enabled debug and submitted the form to see if there's any errors?

Thanks for the tip Drew. Though yes, I've enabled debug, and no errors were displayed. Submitting the form just redirected to the set page, and everything seemed all right – except the issues described behind the scenes.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You'll need to disable the redirect and try again.

Thanks, when disabling redirect the debugging works, and throws the following error:

Debug Message - Perch 3.0.13
[25] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] SELECT * FROM perch3_forms WHERE formKey='contact_me_form' LIMIT 1
[1] SELECT * FROM perch3_pages WHERE pagePath='/' LIMIT 1
Array
(
    [fields] => Array
        (
        )

    [files] => Array
        (
        )

    [page] => /
)
Template file not found: /home2/martonle/public_html/martonlente.com/perch\templates\content\contact_me_form.html
Template file not found: /home2/martonle/public_html/martonlente.com/perch\templates\content\contact_me_form.html
Template file not found: /home2/martonle/public_html/martonlente.com/perch\templates\content\contact_me_form.html
Template file not found: /home2/martonle/public_html/martonlente.com/perch\templates\content\contact_me_form.html
Template file not found: /home2/martonle/public_html/martonlente.com/perch\templates\content\contact_me_form.html
Building message with Dollar template
Message body empty
INSERT INTO perch3_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":[],\"files\":[],\"page\":\"\\/\"}','1','185.104.187.45','{\"fields\":[],\"environment\":{\"PATH\":\"\\/bin:\\/usr\\/bin:\\/usr\\/local\\/bin\",\"HTTP_ACCEPT\":\"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate, br\",\"HTTP_ACCEPT_LANGUAGE\":\"hu-HU,hu;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6\",\"CONTENT_TYPE\":\"application\\/x-www-form-urlencoded\",\"CONTENT_LENGTH\":\"218\",\"HTTP_COOKIE\":\"__utmz=149934506.1517835503.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cmsa=1; __utmc=149934506; __utma=149934506.153069517.1517835503.1517927076.1517932420.7; __utmb=149934506.0.10.1517932420; PHPSESSID=hdlohf6r5f6eli4bgu40m12sd2\",\"HTTP_HOST\":\"martonlente.com\",\"HTTP_REFERER\":\"https:\\/\\/martonlente.com\\/index.php\",\"HTTP_USER_AGENT\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/63.0.3239.132 Safari\\/537.36\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"HTTP_ORIGIN\":\"https:\\/\\/martonlente.com\",\"HTTP_UPGRADE_INSECURE_REQUESTS\":\"1\",\"HTTP_ALEXATOOLBAR_ALX_NS_PH\":\"AlexaToolbar\\/alx-4.0.1\",\"DOCUMENT_ROOT\":\"\\/home2\\/martonle\\/public_html\\/martonlente.com\",\"REMOTE_ADDR\":\"185.104.187.45\",\"REMOTE_PORT\":\"50245\",\"SERVER_ADDR\":\"204.152.215.35\",\"SERVER_NAME\":\"martonlente.com\",\"SERVER_ADMIN\":\"webmaster@martonlente.martonlente.user.archhosting.net\",\"SERVER_PORT\":\"443\",\"REQUEST_URI\":\"\\/\",\"HTTPS\":\"on\",\"X_SPDY\":\"HTTP2\",\"SSL_PROTOCOL\":\"TLSv1.2\",\"SSL_SESSION_ID\":\"dcdc861cc9fad708f87a221806afbb8580a706ae2b545e41c48c6d323ea9d721\",\"SSL_CIPHER\":\"ECDHE-RSA-AES256-GCM-SHA384\",\"SSL_CIPHER_USEKEYSIZE\":\"256\",\"SSL_CIPHER_ALGKEYSIZE\":\"256\",\"SCRIPT_FILENAME\":\"\\/home2\\/martonle\\/public_html\\/martonlente.com\\/index.php\",\"QUERY_STRING\":\"\",\"SCRIPT_URI\":\"https:\\/\\/martonlente.com\\/\",\"SCRIPT_URL\":\"\\/\",\"SCRIPT_NAME\":\"\\/index.php\",\"SERVER_PROTOCOL\":\"HTTP\\/1.1\",\"SERVER_SOFTWARE\":\"LiteSpeed\",\"REQUEST_METHOD\":\"POST\",\"X-LSCACHE\":\"on\",\"PHP_SELF\":\"\\/index.php\",\"REQUEST_TIME_FLOAT\":1517932664.8774,\"REQUEST_TIME\":1517932664,\"argv\":[],\"argc\":0}}')
[1] SELECT * FROM perch3_forms_responses WHERE responseID='7' LIMIT 1
No ids to log.
[1] SELECT * FROM perch3_pages WHERE pagePath='/index.php' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html

The 'template file not found' errors are not present when debugging locally. Can it cause the problem?

By the way the template called 'contact_me_form.html' is a basic perch template living in Perch's template folder, contains Perch's forms tags too, and is used as a shared region across all pages. All pages throw same error message.

I can edit the template's content on the web server too. It's interesting that the error is only present on the webserver, and only when submitting the form – no problem with the paths locally.

Update: Completely deleting the form from within Forms App in Perch on the web server, then resubmitting it again in order to recreate the form seems to solve the issue! :) I'll let you know if I run into a problem inbetween.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's what I was going to suggest. Looks like you've got mixed file systems.