Page 1 of 3

[SOLVED] Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 6:51 am
by pixelita
I just turned a site live tonight and am having problems getting her Contact and Registration forms to work.

I tried every permutation of CMS Mailer to get a test mail. I was finally successful with SendMail.

I also created a "Thank You" page where both forms should dump the user after the user hits "send." CMSMS is NOT honoring this; it just clears the form fields and sits on the contact or registration page.

AND most importantly, no email.

I have created several CMSMS web sites and I checked the settings on those, checked the .htaccess files to see if anything was different, and other than the hosting environment, it is not.

Here is the php info file if anyone needs this:
http://alexandertechniquehouston.com/phpinfo.php

Let me know what else you need. I am running the latest version of CMSMS and no modules require updating. Thanks!

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 6:57 am
by Rolf
You have set a trailing slash as extention in the url? If so disable it or set it to i.e. .html and try again.

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 7:17 am
by pixelita
No. The forms can be accessed here:

http://alexandertechniquehouston.com/contact

and

http://alexandertechniquehouston.com/register

And the thank you page where each form is supposed to go after the user hits "submit":
http://alexandertechniquehouston.com/thank-you

Otherwise I am not sure what you mean.

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 10:40 am
by staartmees
Formbuilder doesn't redirect to a Thank You page. You must put the html-code for a Thank You Page in the Submission Template of the form.

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 10:56 am
by pixelita
That is what I meant. I went to the tab where you can either choose an existing page OR choose a template/HTML response. Either way, the page just sits there, doing nothing more than clearing out the fields after you hit "send."

Also, I checked to see if there were any error logs on her server, and there was nothing, so no clues there either. This is really bugging me. It seems so trivial, but it is the elephant in the room right now.

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 11:27 am
by Rolf
Sorry for my short reply earlier, was working with from HTC-phone ;-) Bit difficult to make long posts...

What I meant is have you set a trailing slash in your URLs. I see URLs in my browser like http://alexandertechniquehouston.com/contact/
At my own sites I don't see the last /

I.e. you unquoted in the .htaccess file:

Code: Select all

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
and/or in the config.php

Code: Select all

$config['page_extension'] = '/';
Why I ask? When I hit the submit button on the form it reloads the page but doesn't show an error message. I have seen this before in combination with the trailing slash...

When did this start for you? Perhaps after moving from test to life server? Can also be a problem with file integrity... Try doing a checksum of both sites to compare...

Just some thoughts...

Rolf :)

Re: Multiple issues with Form Builder

Posted: Sun Jun 23, 2013 11:01 pm
by pixelita
Here is my .htaccess file. And this is the same .htaccess file that works on several live sites with operational contact and other submission forms:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L]
RewriteRule ^post/([0-9]+)/?$ index.php?post=$1 [L]
RewriteRule ^rss/?$ rss.php [L]

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>

<Files 403.shtml>
order allow,deny
allow from all
</Files>
Weirdly, in this instance with this client's site, if I DO NOT comment out this line:

Code: Select all

RewriteCond %{REQUEST_METHOD} !POST$
I get the following error message when I try to submit either the contact or registration form:
Sorry! There was an error handling your form submission.
Here is my config.php file, redacted:

Code: Select all

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = '@@@@@@_cmsms';
$config['db_password'] = '@@@@@@';
$config['db_name'] = '@@@@@@_cmsms';
$config['db_prefix'] = 'cms_';
$config['root_url'] = 'http://alexandertechniquehouston.com';
$config['timezone'] = 'US/Central';
$config['default_encoding'] = 'utf-8';
$config['url_rewriting'] = 'mod_rewrite';
?>

Re: Multiple issues with Form Builder

Posted: Mon Jun 24, 2013 12:39 am
by Dr.CSS
Try using a page extension, .html, .php, etc...

Re: Multiple issues with Form Builder

Posted: Mon Jun 24, 2013 8:07 am
by Rolf
pixelita wrote:Here is my .htaccess file. And this is the same .htaccess file that works on several live sites with operational contact and other submission forms
Something will be different at this website/webhost... :) Just trying to find out *what*

Please add a # before these lines and try again

Code: Select all

RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 5:18 pm
by pixelita
Hi, Rolf. Nice to see you again. I commented out those lines in the .htaccess file, cleared the cache, and tried to submit her contact form. I got this error message:
Sorry! There was an error handling your form submission.
PM me if you want to take on this project.

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 5:24 pm
by pixelita
I also tried Rolf's other suggestion, which was to add this line to my config.php file:

Code: Select all

$config['page_extension'] = '/';
And I got the same error message after clearing the cache.

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 5:59 pm
by velden
- Make sure you do not have checked 'Prevent debug / error messages from being seen by users.' (Menu - Extensions -> FormBuilder -> Configuration tab)

- Check if php errors are disabled and if possible enable those

- Do you have access too apache (error) logfiles? If so seek for error after submitting the form.

- Make sure CMSMailer can send a message without problems.

- Try to send the form with a sender address that really exists on that host/domain. Note that some FormBuilder field types use the visitor-supplied email-address. So use a valid address while filling the form.

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 6:06 pm
by calguy1000
3 things to remember:

a: CMSMS (Smarty + PHP) creates URLS based on a number of factors, mostly the config.php. The generation of URLS is in no way influenced by the .htacsses mod_rewrite stuff.

b: the mod_rewrite stuff is used to rewrite incoming URLS into a format that CMSMS can theoretically understand.

c: Any time you use mod_rewrite a URL and use a 301 redirect POST information is lost.

So. You need to
1: Decide what page extension your URLS will have (if any). I prefer an empty extension, or an extension like .html as opposed to / (/ is just stupid IMnsHO, causes more problems than necessary). Even .php is fine.

2. Modify your config.php to make sure that the desired extension is set.

3. Clear the cache. Every time you change the config.php you clear the cache.

4. modify the .htaccess as appropriate for the page extension you've chosen.
i: If you chose an empty extension or an extension like .html or .php then the doc/htaccess.txt file can be copied to .htaccess in the root directory of your site and it will work fine (does for tens of thousands of users).
ii: if you were silly IMnsHO and chose a / extension then you will have to copy the doc/htaccess.txt file to .htaccess in the root directory of your website AND uncomment the rules related to / as described above.

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 6:56 pm
by velden
Regarding Calguy's post; I would suggest to turn off url_rewriting and rename .htaccess for a moment and test if form submissions is successful.

If so, you're sure there is a problem with the rewriting part of .htaccess.

Re: Multiple issues with Form Builder

Posted: Tue Jun 25, 2013 8:29 pm
by Rolf
pixelita wrote:I also tried Rolf's other suggestion, which was to add this line to my config.php file:

Code: Select all

$config['page_extension'] = '/';
Uhh for the record, I asked you to *not* use the trailing slash ;-) None or i.e. .html makes more sense...