Forum
Perch Form working on local but not on staging?
Hi,
I'm having a problem getting Perch to pickup a contact form. The form displays fine, but when I submit the form it is not registered in the admin area. The code has been working fine on my local version without issue - the form submits without hitch. Form Code, Diagnostics and Debug for before and after submitting the form are below.
I have tried deleting and reassigning the template to the page, but this creates no change. Perch still doesn't pick up the contact form in the admin area. All other forms throughout the site are working correctly though, so I've gone wrong somewhere...
Form Code
Calling the form from the page
<?php perch_form('contact-form.html'); ?>
contact-form.html
<perch:form id="contact" method="post" app="perch_forms" role="form" class="contact-form">
<perch:error for="all" type="general">
<div data-alert class="alert-box alert radius">
<perch:content type="textarea" id="error" label="General error message" textile="true" editor="markitup"/>
</div>
</perch:error>
<div class="row">
<FIELDSET>
<div class="medium-6 columns">
<div class="<perch:error for="first_name" type="required">alert-box alert radius</perch:error>">
<perch:label for="first_name">First name<sup>*</sup></perch:label>
<perch:input type="text" label="First Name" id="first_name" placeholder="Your first name…" required="true" />
<perch:error for="first_name" type="required">
Please add your first name.
</perch:error>
</div>
</div>
<div class="medium-6 columns">
<div class="<perch:error for="last_name" type="required">alert-box alert radius</perch:error>">
<perch:label for="last_name">Last name<sup>*</sup></perch:label>
<perch:input type="text" label="Last Name" id="last_name" placeholder="Your last name…" required="true" />
<perch:error for="last_name" type="required">
Please add your last name.
</perch:error>
</div>
</div>
<div class="medium-6 columns">
<div class="<perch:error for="email_address" type="required">alert-box alert radius</perch:error><perch:error for="email_address" type="format">alert-box alert radius</perch:error>">
<perch:label for="email_address">Email address<sup>*</sup></perch:label>
<perch:input type="email" label="Email Address" id="email_address" placeholder="Your email address…" />
<perch:error for="email_address" type="required">
Please add your email address.
</perch:error>
<perch:error for="email_address" type="format">
Please check your email address.
</perch:error>
</div>
</div>
<div class="medium-6 columns">
<perch:label for="company_name">Company name</perch:label>
<perch:input type="text" label="Company Name" id="company_name" placeholder="Your company name…" />
</div>
<div class="large-6 medium-6 small-12 columns">
<perch:label for="capability">Help us guide your enquiry</perch:label>
<perch:input id="capability" type="select" options="General Enquiry|general-enquiry, Business Enquiry|business-enquiry, Press and Media Enquiry|press-media-enquiry, Other|other" />
</div>
<div class="large-6 medium-6 small-12 columns">
<perch:label for="capability">Is your enquiry relevant to our Technologies?</perch:label>
<perch:input id="capability" type="select" default="Select Technology" options="Select Technology, Biologics|biologics, Formulation|formulation, Graphene|graphene, Industrial Biotechnology and Biorefining|industrial-biotechnology-and-biorefining, Printable Electronics|printable-electronics" />
</div>
<div class="medium-12 columns">
<div class="<perch:error for="email_address" type="required">alert-box alert radius</perch:error>">
<perch:label for="message">Message<sup>*</sup></perch:label>
<perch:input type="textarea" label="Message" id="message" rows="6" placeholder="Your message…" required="true" />
<perch:error for="message" type="required">
Please add your message.
</perch:error>
</div>
<perch:input type="submit" id="submit" value="Submit" class="button radius" />
</div>
<perch:success>
<div data-alert class="alert-box success radius">
Thank you! We have received your message and will be in touch shortly.
</div>
</perch:success>
</FIELDSET>
</div>
</perch:form>
Diagnostic Report
Perch Runway: 2.8.34, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), collection_5 (2.8.34), collection_2 (2.8.34), collection_1 (2.8.34), collection_9 (2.8.34), collection_6 (2.8.34), collection_14 (2.8.34), collection_11 (2.8.34), perch_forms (1.8.3), collection_12 (2.8.34), collection_4 (2.8.34), collection_10 (2.8.34), collection_13 (2.8.34), collection_8 (2.8.34), collection_3 (2.8.34), collection_7 (2.8.34), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members', 'perch_forms', );
PERCH_LOGINPATH: /login
PERCH_PATH: /home/backupadmin/public_html/login
PERCH_CORE: /home/backupadmin/public_html/login/core
PERCH_RESFILEPATH: /home/backupadmin/public_html/login/resources
Image manipulation: GD
PHP limits: Max upload 1024M, Max POST 1024M, Memory: -1M, Total max file upload: -1M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
HTTP_HOST: XXXXX.uk-cpi.com
DOCUMENT_ROOT: /home/backupadmin/public_html
REQUEST_URI: /login/core/settings/diagnostics/
SCRIPT_NAME: /login/core/settings/diagnostics/index.php
Debug Before Submit
Debug Message
[89] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched page: /contact, so not using routes.
Using master page: /templates/pages/contact/index.php
[1] SELECT * FROM perch2_pages WHERE pagePath='/contact' LIMIT 1
[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/contact' OR regionPage='*' ORDER BY regionPage DESC
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
Using sub-template: /templates/pages/attributes/facebook.html
Using sub-template: /templates/pages/attributes/twitter.html
Using sub-template: /templates/pages/attributes/article.html
Using template: /templates/search/search-form.html
[1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Technology'
[5] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='title' WHERE (idx.collectionID=3) AND ((idx.indexKey='hide' AND idx.indexValue != 'true')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
[5] Using template: /templates/content/tech/_tech_menu.html
Using template: /templates/search/search-form.html
Using template: /templates/pages/attributes/header-wrap.html
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/contact' OR pageSortPath='/contact' LIMIT 1
[1] SELECT * FROM perch2_pages WHERE pageHidden=0 AND pageNew=0 AND pageTreePosition IN ('000-025', '000') ORDER BY pageTreePosition
[1] Using template: /templates/navigation/breadcrumbs.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Heading' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=98 AND idx.itemRev=1)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_page_subheading.html
[29] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/forms/contact-form.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Contact Sidebar' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=99 AND idx.itemRev=1)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_page_contact_sidebar.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Feedback' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=4 AND idx.itemRev=3)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_feedback.html
Using sub-template: /templates/content/global/_feedback_form.html
Request time: 0.1088
Process time: 0.108
Memory: 4.9628
Debug After Submit
Debug Message
[89] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched page: /contact, so not using routes.
Using master page: /templates/pages/contact/index.php
[1] SELECT * FROM perch2_pages WHERE pagePath='/contact' LIMIT 1
[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/contact' OR regionPage='*' ORDER BY regionPage DESC
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
Using sub-template: /templates/pages/attributes/facebook.html
Using sub-template: /templates/pages/attributes/twitter.html
Using sub-template: /templates/pages/attributes/article.html
Using template: /templates/search/search-form.html
[1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Technology'
[5] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='title' WHERE (idx.collectionID=3) AND ((idx.indexKey='hide' AND idx.indexValue != 'true')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
[5] Using template: /templates/content/tech/_tech_menu.html
Using template: /templates/search/search-form.html
Using template: /templates/pages/attributes/header-wrap.html
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/contact' OR pageSortPath='/contact' LIMIT 1
[1] SELECT * FROM perch2_pages WHERE pageHidden=0 AND pageNew=0 AND pageTreePosition IN ('000-025', '000') ORDER BY pageTreePosition
[1] Using template: /templates/navigation/breadcrumbs.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Heading' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=98 AND idx.itemRev=1)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_page_subheading.html
[29] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/forms/contact-form.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Contact Sidebar' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=99 AND idx.itemRev=1)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_page_contact_sidebar.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Feedback' AND (regionPage='/contact' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=4 AND idx.itemRev=3)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_feedback.html
Using sub-template: /templates/content/global/_feedback_form.html
Request time: 0.1133
Process time: 0.1124
Memory: 4.9628
What do you see when you submit the form?
After submission the form (or page) reloads with the fields blank, like they've been reset. No success message pops up.
If you view source on the page, what
action
does the form tag have?It has the following action tag:
action="/contact"
And is that where you end up when the form is posted? Not
/contact/
or anything similar but different?Yes that's right, we end up at
/contact
rather than any other variation of the URL or page slug.Is the form in a template include?
It's not, no. Should I try it as a template include?
No, that was just a thought. Is there anything else you can tell me about this?
Sorry Drew, I've discovered that the problem was with the .htaccess file on the server. Thank you for your help though!