Forum

Thread tagged as: Question, Problem, Forms

Form app not registering form submission

Hi guys, I'm hoping you can help, I can't get my contact form to submit to the app in my admin area.

I'm using the exact template in the tutorials and when i submit the form the success response comes up, but the app doesn't come up in the admin area.

I'm using a rewrite rule to manage the URL

RewriteRule ^apply.php$ index.php?p=apply&s=none

and I'm setting the page with PerchSystem::set_page('apply.php')

is there any thing obvious I could do ? Thanks in advance

Dylan Rynhart

Dylan Rynhart 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Have you added the Forms app to the config file apps.php?

Hi Rachel, Yeah I have:

<?php
    include(PERCH_PATH.'/core/apps/content/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_members/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php');
?>

And the forms app comes up in the admin section also ?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn debug on for the page and let me know what it outputs after submitting the form?

Ok, this is really strange, I enabled Debug in the config : define('PERCH_DEBUG', true);

and I added it to the page:

<?php PerchUtil::output_debug(); ?>

Then, all my page regions reset on that page ??

So I reapplied the template to my form region, reloaded the page, submitted the form, and now it shows up in the form app

Is that normal ?

Sorry, here is the debug info:

DIAGNOSTICS:
SELECT * FROM perch2_pages WHERE pagePath='/index.php' LIMIT 1
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT * 
FROM perch2_forms
WHERE formKey='contact'
LIMIT 1
INSERT INTO perch2_forms(formKey,formTemplate,formOptions,formTitle) VALUES('contact','/templates/content/cheque_contact_form.html','{\"store\":true}','Contact')
SELECT *
FROM perch2_forms 
WHERE formID='1'
LIMIT 1
INSERT INTO perch2_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"name\":{\"attributes\":{\"type\":\"text\",\"id\":\"name\",\"required\":\"true\",\"label\":\"Name\"},\"value\":\"test\"},\"email\":{\"attributes\":{\"type\":\"email\",\"id\":\"email\",\"required\":\"true\",\"label\":\"Email\",\"placeholder\":\"you@company.com\"},\"value\":\"fds@fds.com\"},\"message\":{\"attributes\":{\"type\":\"textarea\",\"id\":\"message\",\"required\":\"true\",\"label\":\"Message\"},\"value\":\"rhigr regregre\"}},\"files\":[]}','1','46.7.130.9','{\"fields\":[],\"environment\":{\"PATH\":\"\\/usr\\/local\\/bin:\\/usr\\/bin:\\/bin\",\"REDIRECT_HANDLER\":\"php-cgi-script\",\"REDIRECT_STATUS\":\"200\",\"UNIQUE_ID\":\"VFtImn8AAAEACKxVc0sAAAAU\",\"SCRIPT_URL\":\"\\/apply_test.php\",\"SCRIPT_URI\":\"https:\\/\\/www.musicfestival.ie\\/apply_test.php\",\"PHPRC\":\"\\/var\\/www\\/vhosts\\/18\\/304723\\/php\",\"HTTP_HOST\":\"www.musicfestival.ie\",\"HTTP_ACCEPT\":\"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,*\\/*;q=0.8\",\"HTTP_ACCEPT_LANGUAGE\":\"en-us\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"CONTENT_TYPE\":\"application\\/x-www-form-urlencoded\",\"HTTP_ORIGIN\":\"https:\\/\\/www.musicfestival.ie\",\"CONTENT_LENGTH\":\"158\",\"HTTP_CONNECTION\":\"keep-alive\",\"HTTP_USER_AGENT\":\"Mozilla\\/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit\\/600.1.25 (KHTML, like Gecko) Version\\/8.0 Safari\\/600.1.25\",\"HTTP_REFERER\":\"https:\\/\\/www.musicfestival.ie\\/apply_test.php\",\"HTTP_COOKIE\":\"address=sadsa%2C+sadas%2Csa+; application_type=Individual; apply_session=6f38fe0ca999295b5f3bde53ebf49e9c; apply_stage=3; cc_analytics=yes; cc_necessary=yes; cms-form=YXBwbGljYXRpb246cGVyY2hfZm9ybXM6L3RlbXBsYXRlcy9jb250ZW50L2FwcGxpY2F0aW9uX2Zvcm0uaHRtbA%3D%3D; dob1=1999-06-14; dob2=0000-00-00; email=ds%40fds.com; fullname1=Test+1; guardian_name=Fdhee; master_session=6f38fe0ca999295b5f3bde53ebf49e9c; mob=2389102839021; PHPSESSID=819c061e81a8477b82fccff740b9b15a; school_name=dsadwdwdw; school_type=Secondary; _ga=GA1.2.1942627951.1411114347; _gat=1\",\"SERVER_SIGNATURE\":\"\",\"SERVER_SOFTWARE\":\"Apache\",\"SERVER_NAME\":\"www.musicfestival.ie\",\"SERVER_ADDR\":\"185.2.67.8\",\"SERVER_PORT\":\"80\",\"REMOTE_ADDR\":\"46.7.130.9\",\"DOCUMENT_ROOT\":\"\\/var\\/www\\/vhosts\\/18\\/304723\\/webspace\\/httpdocs\\/musicfestival.ie\",\"SERVER_ADMIN\":\"you@example.com\",\"SCRIPT_FILENAME\":\"\\/var\\/www\\/vhosts\\/18\\/304723\\/webspace\\/httpdocs\\/musicfestival.ie\\/index.php\",\"REMOTE_PORT\":\"56123\",\"REDIRECT_REMOTE_USER\":\"imf\",\"REDIRECT_QUERY_STRING\":\"p=apply_test&s=none\",\"REDIRECT_URL\":\"\\/index.php\",\"GATEWAY_INTERFACE\":\"CGI\\/1.1\",\"SERVER_PROTOCOL\":\"HTTP\\/1.1\",\"REQUEST_METHOD\":\"POST\",\"QUERY_STRING\":\"p=apply_test&s=none\",\"REQUEST_URI\":\"\\/apply_test.php\",\"SCRIPT_NAME\":\"\\/index.php\",\"ORIG_SCRIPT_FILENAME\":\"\\/opt\\/alt\\/php55\\/usr\\/bin\\/php-cgi\",\"ORIG_PATH_INFO\":\"\\/index.php\",\"ORIG_PATH_TRANSLATED\":\"\\/var\\/www\\/vhosts\\/18\\/304723\\/webspace\\/httpdocs\\/musicfestival.ie\\/index.php\",\"ORIG_SCRIPT_NAME\":\"\\/cgi-php\\/php-cgi\",\"PHP_SELF\":\"\\/index.php\",\"REQUEST_TIME_FLOAT\":1415268506.3644,\"REQUEST_TIME\":1415268506}}')
SELECT *
FROM perch2_forms_responses 
WHERE responseID='1'
LIMIT 1

SELECT regionKey, regionHTML FROM perch2_content_regions
WHERE regionPage='/apply_test.php' OR regionPage='*'
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='page_info' AND (regionPage='/apply_test.php' OR regionPage='*')
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='49' AND idx.itemRev='0')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev
) as tbl GROUP BY itemID ORDER BY sortval ASC LIMIT 0, 1
Using template: /templates/content/_page_title.html
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='49' AND idx.itemRev='0')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev
) as tbl GROUP BY itemID ORDER BY sortval ASC LIMIT 0, 1
Using template: /templates/content/_page_title.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by reset?

I can see the form response going into the database.

Hey Drew, The Resetting was caused by me pointing perch to the wrong DB. In fact, when I deleted the region and reset it the form worked. I'm not sure why it didn't before, but it's fine now ? No code changed ? Thanks for your help Dylan