Forum

Thread tagged as: Question, Problem, Forms

Questions/ issues with Perch forms

Hi, I have got a contact form basically working in Perch, but am still running into a few issues. It seems to me that I've run into some bugs here, but you'll have to let me know what you think about that.

  1. When I log in to Perch, and go to the Forms page (title: 'Listing Forms'), I see 3 forms, all called the same thing ('ContactForm'), and all with an identical number of responses listed. Why are there 3 identical forms listed here? My intention is to have one contact form available across the website, the form submitted from different pages on that site, but with all submissions coming together in a single place.

  2. When I then click on one of these forms to see the responses, I seem to hit a bug. Hitting 'view response' for any message displays the same message - one sent 11/07/2018, a seemingly spammy message (it's in Russian script, with a web url). What's going on here? Possibly related, the response numbering is weird - it lists multiple messages as #0. However - clicking 'download csv' does return the correct responses, so the form responses are being stored in Perch, just not output properly via the Form Responses screen.

  3. Finally - I have had trouble with spam submissions. I want to check: in order for Akismet to work on my Contact Form, I need to put the Akismet key in the Blog settings of Perch - is that right? i.e., I am checking there is no Form settings of Perch somewhere that I need to add the Akismet key to. As I understand it, I also need to add "antispam=..." to the perch input tags on the Contact Form. Then is that sufficient to get the antispam working? Is there then any way that I can check Akismet is working, or test it out?

Thanks for your help. Let me know if you need screen shots or any additional information on the above.

Mark Day

Mark Day 0 points

  • 3 months ago
Drew McLellan

Drew McLellan 2603 points
Perch Support

Could you post your diagnostics report please?

Mark Day

Mark Day 0 points

Hi Drew, thanks for your reply and my apologies I've taken so long to see it! Diagnostics report follows:

Health check Perch is out of date. You are running Perch 3.0.14 and the latest is 3.1.2. Update instructions PHP 5.6.24 is up to date MySQL 5.6.41 is up to date Image processing available Summary information Perch: 3.0.14, PHP: 5.6.24, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (3.0.14), assets (3.0.14), categories (3.0.14), perch_blog (5.6.1), perch_forms (1.11) App runtimes: <?php $apps_list = array( 'perch_blog', 'perch_forms', ); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /home/whiterosevisas/public_html/perch PERCH_CORE: /home/whiterosevisas/public_html/perch/core PERCH_RESFILEPATH: /home/whiterosevisas/public_html/perch/resources Image manipulation: GD Imagick PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M F1: 3b606135b33e6a102526838f4152a807 Resource folder writeable: Yes DOCUMENT_ROOT: /home/whiterosevisas/public_html HTTP_HOST: www.whiterosevisas.co.uk REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Drew McLellan

Drew McLellan 2603 points
Perch Support

First thing I'd suggest is making sure you're running the current version of Perch and Forms.

Mark Day

Mark Day 0 points

OK, thanks Drew, I'll do that and then get back to you.

Mark Day

Mark Day 0 points

Hello Drew, an update: I have updated the Perch app and the Forms add-on to the latest versions. Everything is now up to date as far as I'm aware. Returning to the 3 issues listed in my first post ... #1 and #2 are still problematic - the updates have made no change there. And question #3 still stands. I look forward to your further advice. Thanks, Mark

Drew McLellan

Drew McLellan 2603 points
Perch Support

When you submit a new response, is it added to all three instances?

Mark Day

Mark Day 0 points

Yes, I have checked again today - the latest response went to all three instances.

As per my initial post, note that this latest response is NOT properly visible in the 'Form Responses' list (in any of the three instances). There is instead a weird dummy/ spam response listed. The Response has a number of #0 (along with loads of other form responses), correct date and time, and when you click on on Detail/ View Response it gives erroneous detail - spammy detail, as per my initial post. (It might be useful to attach a screen shot to show what I mean - is that possible in this forum?)

However, the latest response IS viewable in the downloadable csv - and in that case it is visible for all three form instances.

Drew McLellan

Drew McLellan 2603 points
Perch Support

Can you turn on debug for your page, submit the form, and then let me know what it outputs at that point? Needs to be immediately after the form is posted.

Mark Day

Mark Day 0 points

Here you go Drew, hopefully this gives you what you need:

Debug Message - Perch 3.1.2 [1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='611bbe302d0af40babb6cb07404cf851' LIMIT 1 UPDATE perch3_users SET userHash='bf88ab4f43c0b6929bf510b6553d24f3' WHERE userID='1' [31] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC [8] SELECT itemValue FROM perch3_menu_items WHERE itemType='app' [1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1 [3] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC [1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='settings' LIMIT 1 [1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10 [2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC File: /core/settings/modes/diagnostics.post.php Queries: 10 Memory: 3.1584

Drew McLellan

Drew McLellan 2603 points
Perch Support

That looks like the debug output from the Settings section in the Perch control panel.

Submit the form on your page and show me the diagnostics from there. That's the only one that's going to give any information about the posting of the form.

Hi Drew, sorry about that, I misunderstood. The following should be what you need:

Debug Message - Perch 3.1.2 [31] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0 [1] SELECT * FROM perch3_forms WHERE formKey='contactForm' LIMIT 1 [1] SELECT * FROM perch3_pages WHERE pagePath='/family.html' LIMIT 1 Array ( [fields] => Array ( )

[files] => Array
    (
    )

[page] => /family.html

) Checking Akismet for spam Message is not spam Building message with Dollar template Sent email: "New enquiry to White Rose Visas" to info@whiterosevisas.co.uk Using email template: /home/whiterosevisas/public_html/perch/core/emails/.txt (txt) Building message with Dollar template Sent email: "Thank you for your enquiry to White Rose Visas" to mark@whiterosevisas.co.uk INSERT INTO perch3_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"Name\":{\"attributes\":{\"type\":\"text\",\"class\":\"form-control\",\"id\":\"Name\",\"placeholder\":\"Name\",\"required\":\"yes\",\"antispam\":\"name\"},\"value\":\"Mark Day\"},\"Email\":{\"attributes\":{\"type\":\"email\",\"class\":\"form-control\",\"id\":\"Email\",\"placeholder\":\"Email\",\"antispam\":\"email\"},\"value\":\"mark@whiterosevisas.co.uk\"},\"Phone\":{\"attributes\":{\"type\":\"tel\",\"class\":\"form-control\",\"id\":\"Phone\",\"placeholder\":\"Telephone\"},\"value\":\"32479823749237\"},\"Enquiry\":{\"attributes\":{\"type\":\"textarea\",\"class\":\"form-control\",\"rows\":\"4\",\"id\":\"Enquiry\",\"placeholder\":\"Enquiry\",\"required\":\"yes\",\"antispam\":\"body\"},\"value\":\"This is a test, no need for anyone to take any action!!\"},\"MailingList\":{\"attributes\":{\"type\":\"radio\",\"name\":\"MailingList\",\"id\":\"MailingList\",\"value\":\"yes\",\"\":true},\"value\":\"no\"}},\"files\":[],\"page\":\"\/family.html\"}','2','84.93.174.159','{\"fields\":{\"name\":\"Mark Day\",\"email\":\"mark@whiterosevisas.co.uk\",\"body\":\"This is a test, no need for anyone to take any action!!\"},\"environment\":{\"CONTENT_LENGTH\":\"285\",\"CONTENT_TYPE\":\"application\/x-www-form-urlencoded\",\"CONTEXT_DOCUMENT_ROOT\":\"\/home\/whiterosevisas\/public_html\",\"CONTEXT_PREFIX\":\"\",\"DOCUMENT_ROOT\":\"\/home\/whiterosevisas\/public_html\",\"GATEWAY_INTERFACE\":\"CGI\/1.1\",\"HTTP_ACCEPT\":\"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"HTTP_ACCEPT_LANGUAGE\":\"en-GB,en;q=0.9,en-US;q=0.8\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"HTTP_CONNECTION\":\"keep-alive\",\"HTTP_COOKIE\":\"__utmz=57942508.1529077816.14.3.utmcsr=whiterosevisas.com|utmccn=(referral)|utmcmd=referral|utmcct=\/; __utma=57942508.555166684.1504628419.1530028061.1530608027.19; logged_in=e53769a84669308a9a8257d171a11fdf945dbf44b5e52f667a92332daa7793a1d8edc4237f251b069fb45ca80566ad63724fe3272d7ebedb93a82639f721a67b; _ga=GA1.3.555166684.1504628419; cmsa=1; PHPSESSID=cvgi7sd3ibuj87872e28l8uhv3; _gid=GA1.3.286799610.1540290940; _gat_gtag_UA_3716610_4=1\",\"HTTP_HOST\":\"www.whiterosevisas.co.uk\",\"HTTP_ORIGIN\":\"http:\/\/www.whiterosevisas.co.uk\",\"HTTP_REFERER\":\"http:\/\/www.whiterosevisas.co.uk\/family.html\",\"HTTP_UPGRADE_INSECURE_REQUESTS\":\"1\",\"HTTP_USER_AGENT\":\"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/69.0.3497.100 Safari\/537.36\",\"PATH\":\"\/bin:\/usr\/bin\",\"QUERY_STRING\":\"\",\"REDIRECT_STATUS\":\"200\",\"REMOTE_ADDR\":\"84.93.174.159\",\"REMOTE_PORT\":\"51985\",\"REQUEST_METHOD\":\"POST\",\"REQUEST_SCHEME\":\"http\",\"REQUEST_URI\":\"\/family.html\",\"SCRIPT_FILENAME\":\"\/home\/whiterosevisas\/public_html\/family.html\",\"SCRIPT_NAME\":\"\/family.html\",\"SERVER_ADDR\":\"83.223.103.26\",\"SERVER_ADMIN\":\"webmaster@whiterosevisas.co.uk\",\"SERVER_NAME\":\"www.whiterosevisas.co.uk\",\"SERVER_PORT\":\"80\",\"SERVER_PROTOCOL\":\"HTTP\/1.1\",\"SERVER_SIGNATURE\":\"\",\"SERVER_SOFTWARE\":\"Apache\",\"TZ\":\"Europe\/London\",\"UNIQUE_ID\":\"W875plPfexAAAKHUb6wAAAAI\",\"PHP_SELF\":\"\/family.html\",\"REQUEST_TIME_FLOAT\":1540290982.3317,\"REQUEST_TIME\":1540290982}}') [1] SELECT * FROM perch3_forms_responses WHERE responseID=1 LIMIT 1 [1] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/family.html' OR regionPage='*' ORDER BY regionPage DESC Array ( [type] => 8 [message] => Undefined index: url [file] => /home/whiterosevisas/public_html/perch/addons/apps/perch_forms/PerchForms_Akismet.class.php [line] => 48 )