We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    Haven’t tried MachForm myself but might be worth trying :
    <form id="form_1" class="appnitro"  method="post" action="[*id*]#main_body">
    

    This usually cures being redirected to your home page.
      • 7319
      • 21 Posts
      Thanks for your answer, Ive tried changing the action attribut as you mentioned but unfortunately I doesnt show up in the form. Can someone point me to the right document and line please. Ive tried to change the view_funcions.php at line 1840 without any effect (see below).

      <h1><a>{$form->name}</a></h1>
      <form id="form_{$form->id}" class="appnitro" {$form_enc_type} method="post" action="[*id*]#main_body">
      {$form_desc_div}
      <ul {$ul_class}>
      {$form->error_message}
      {$all_element_markup}
      {$custom_element}
      {$button_markup}
      </ul>
      </form>
        • 5976
        • 30 Posts


        It is better when MACHFORM is integrated as a module within Modx. If you are having problems installing it as a module as described here on this thread, take a look at your .htaccess file.
        To get machform going, comment out this line: # RewriteRule ^(.*)$ ~modxfolder/index.php?q=$1 [L,QSA].

        I initially had a difficult time installing it as a module, until i commented out the line above within my .htaccess file.


        Thanks Webman but unfortunately still stuck.
        I followed the instructions in this forum but still experiencing the same problem ie. form appears to work but, like diamondz problem" I get redirected to the homepage and no entries are recorded in Machform. I commented out the rewrite rule but that didn’t help. I installed both Modx & Machform in the root dir and have changed the index.php accordingly. I set up the module with the following code:
        include_once $modx->config[’base_path’] . "forms/index.php";
        (Machforms is installed in the forms dir)
        I took the php code from Machforms Embed code window, created a new snippet in Modx, pasted the code and named it "orderf", set up a new page in Modx, put [[orderf]] as the Document content, published it, viewed it successfully, but when I submitted the form... back to the homepage and no entry listed. Tryied this logged in and logged out.
        Would love to get this working as I don’t like using the iframe as it can be untidy cross browser.
          • 10226
          • 412 Posts
          well that was a waste of time and money. I should have known better.. %!@#$&
            • 32142
            • 19 Posts
            Quote from: fruitwerks at Jul 28, 2009, 04:31 AM

            well that was a waste of time and money. I should have known better.. %!@#$&


            Hallo Fruitwerks,


            Just coming in late to the discussion. Sorry to hear that you guys are not having any success with this excellent form. I have just responded to another mail which I am going to post here again in case
            anyone may have a use for it.

            Initially i also had a hard time setting it up, but it is really relatively easy to do once you are able to have a correctly configured .htaccess file in addition to have the correct folder pathways pointing to
            your MACHFORM folder within the modified index.php file, everything should work properly.

            -------------------------------------------------

            Dear Saran,

            Sorry for coming late to your note. I was away for holiday. In any case, installing MACHFORM within MODX is fairly easy but at first can be quite tricky.
            I have setup about 4 working copies of MACHFORM on 4 different MODX sites, and they were all relatively easy to setup.
            The only thing which you need to do to make sure your form works is to tweak your .htaccess file. MACHFORM apparently will not work at all if the settings
            in the .htaccess file are not properly set.
            With that said, make sure that you comment out completely this line in your .htaccess file.

            ---------------------------------------------------------------------
            # RewriteRule ^(.*)$ ~yoursite folder/index.php?q=$1 [L,QSA]
            ---------------------------------------------------------------------

            Depending on your webhost it may differ. But that is the crucial key in allowing machform to co-exist alongside with MODX.

            Another question.
            Where is your MACHFORM folder sitting within your MODX folder structure...?
            In the manager folder...??
            If yes, also make sure to put in the correct folder pathway within your modified machform index file.

            My own MACHFORM sits within my MODX site folder. Here is the modified version of the index php file which you need
            to substitute with the original index php that came with your MACHFORM.

            If you have followed all the instructions as indicated here on the forum you will have a working copy right away..

            -------------------------------
            <?php
            //AppNitro Modx Integration for Login
            //
            //Changes 20 Sep 08.
            //(Modified index.php slightly because Manager check didn’t work properly 100% of the time. Now use $_SESSION[mgrValidated] instead...)
            //
            //
            session_start();

            require(’config.php’);
            require(’includes/db-core.php’);
            require(’includes/db-functions.php’);
            require(’includes/helper-functions.php’);

            $path_to_folder=’/pathway to your machform’;

            $ssl_suffix = get_ssl_suffix();

            if(file_exists("installer.php")){
            header("Location: http{$ssl_suffix}://".$_SERVER[’HTTP_HOST’].$path_to_folder."/installer.php");
            exit;
            }


            //Are we running this from the MODx Manager?
            if (!empty($_SESSION[’mgrValidated’]) && $_SESSION[’mgrValidated’] == false) {
            echo "Sorry, this file can only be run from the MODx Manager";
            exit;
            }


            //We’re in the manager, so force login
            $_SESSION[’logged_in’] = true;
            header("Location: http{$ssl_suffix}://".$_SERVER[’HTTP_HOST’].$path_to_folder."/manage_form.php");
            exit; //Just in case(tm)
            ?>
            ---------------------------------


            Let me know if this works out for you.


            Thanks.
              • 7319
              • 21 Posts
              Hi Webman,

              Im still stuck with it. When I comment out the line
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              my friendly urls wont work anymore.
              I dont have another line in my htaccess file which looks like this so I dont know what else I could change.

              Here is my complete htaccess file, would be great If you could have a look into it. I really want to get this to work since its an awesome module.

              # MODx supports Friendly URLs via this .htaccess file. You must serve web
              # pages via Apache with mod_rewrite to use this functionality, and you must
              # change the file name from ht.access to .htaccess.
              #
              # Make sure RewriteBase points to the directory where you installed MODx.
              # E.g., "/modx" if your installation is in a "modx" subdirectory. If you have
              # problems with your .htaccess working at all, try un-commenting the first 
              # line above the "RewriteEngine On" directive.
              #
              # You may choose to make your URLs non-case-sensitive by adding a NC directive
              # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
              
              #Options +FollowSymlinks
              RewriteEngine On
              RewriteBase /
              
              
              # Fix Apache internal dummy connections from breaking [(site_url)] cache
              RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
              RewriteRule .* - [F,L]
              
              
              # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
              RewriteCond %{HTTP_HOST} .
              RewriteCond %{HTTP_HOST} !^betriebsausflug\.com [NC]
              RewriteRule (.*) http://betriebsausflug.com/$1 [R=301,L]
              
              
              Options +FollowSymlinks
              RewriteEngine on
              RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
              RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
              #
              # or for the opposite domain.com -> www.domain.com use the following
              # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
              #
              #RewriteCond %{HTTP_HOST} .
              #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
              #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
              
              
              
              # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
              # https://www.domain.com when your cert only allows https://secure.domain.com
              #RewriteCond %{SERVER_PORT} !^443
              #RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]
              
              
              
              # The Friendly URLs part
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              
              
              
              # Make sure .htc files are served with the proper MIME type, which is critical # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
              
              #AddType text/x-component .htc
              
              
              
              # If your server is not already configured as such, the following directive
              # should be uncommented in order to set PHP's register_globals option to OFF.
              # This closes a major security hole that is abused by most XSS (cross-site
              # scripting) attacks. For more information: http://php.net/register_globals
              #
              # To verify that this option has been set to OFF, open the Manager and choose
              # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
              # for "register_globals". The Local Value should be OFF. If the Master Value
              # is OFF then you do not need this directive here.
              #
              # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
              #
              # Your server does not allow PHP directives to be set via .htaccess. In that
              # case you must make this change in your php.ini file instead. If you are
              # using a commercial web host, contact the administrators for assistance in
              # doing this. Not all servers allow local php.ini files, and they should
              # include all PHP configurations (not just this one), or you will effectively
              # reset everything to PHP defaults. Consult www.php.net for more detailed
              # information about setting PHP directives.
              
              #php_flag register_globals Off
              
              
              
              # For servers that support output compression, you should pick up a bit of
              # speed but un-commenting the following lines.
              
              #php_flag zlib.output_compression On
              #php_value zlib.output_compression_level 5
              
              
              
              # The following directives stop screen flicker in IE on CSS rollovers. If
              # needed, un-comment the following rules. When they're in place, you may have
              # to do a force-refresh in order to see changes in your designs.
              
              #ExpiresActive On
              #ExpiresByType image/gif A2592000
              #ExpiresByType image/jpeg A2592000
              #ExpiresByType image/png A2592000
              #BrowserMatch "MSIE" brokenvary=1
              #BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
              #BrowserMatch "Opera" !brokenvary
              #SetEnvIf brokenvary 1 force-no-vary
              
              RewriteRule ^america‘s-cup-yachting/ americas-cup-yachting/ [R,NC,L]
                • 32142
                • 19 Posts
                Hi diamondz,

                I just got your PM and have responded already. Give me some few moments over here [by the way, I am in Berlin also] and I will copy paste my own .htaccess files for you to compare with yours and see where the fault lies.
                I am using MACHFORM with MODXcms 0.9.6.3 on some sites now.

                Thanks.

                  • 32142
                  • 19 Posts
                  Hi Diamondz,

                  Actually as strange as it may sound, I am not even using the .htaccess file which came along with my MODXcms installer. I have a modified .htaccess from another web application which I modified and have been
                  using with all of my MODXcms installations.
                  This allows me the liberty of using friendly URLs, run Machform within MODX and other external PHP applications without any problems at all.

                  From what I have here with me, it is completely different from your own .htaccess file. So if you are also on 1und1 AG, this particular file might work well for you.
                  Let me know then if your ISP is 1und1. AG

                  Thanks.
                    • 7319
                    • 21 Posts
                    hey webman,
                    thanks for your reply. Funny that you are in Berlin too. Maybe we can meet someday.
                    We have our server at Domainfactory which gives us a lot of freedom in terms of changing
                    the ini files etc.

                    My knowledge, however, is very limited in regards to the htaccess file. Im very thankful for every hint that you might give me, because
                    the snippet is so useful and I really want to get it to work.

                      • 32142
                      • 19 Posts
                      Quote from: diamondz at Sep 04, 2009, 06:10 PM

                      hey webman,
                      thanks for your reply. Funny that you are in Berlin too. Maybe we can meet someday.
                      We have our server at Domainfactory which gives us a lot of freedom in terms of changing
                      the ini files etc.

                      My knowledge, however, is very limited in regards to the htaccess file. Im very thankful for every hint that you might give me, because
                      the snippet is so useful and I really want to get it to work.



                      Hi Diamondz,

                      Just got back again. But here is my .htaccess file on my 1und1 webspace.
                      It is a modified file, which I got from my Magento Ecommerce Suite
                      So try it out.

                      Did you also make sure to follow step by step the instructions to modify
                      your MACHFORM index.php file...??
                      Making sure that all the url paths are accurate....???
                      You may want to also check your URL paths in the modified index.php

                      -------------------------------------------------------

                      ############################################
                      ## uncomment these lines for CGI mode
                      ## make sure to specify the correct cgi php binary file name
                      ## it might be /cgi-bin/php-cgi

                      # Action php5-cgi /cgi-bin/php5-cgi
                      # AddHandler php5-cgi .php

                      ############################################
                      ## GoDaddy specific options

                      # Options -MultiViews

                      ## you might also need to add this line to php.ini
                      ## cgi.fix_pathinfo = 1
                      ## if it still doesn’t work, rename php.ini to php5.ini

                      ############################################
                      ## this line is specific for 1and1 hosting

                      AddType x-mapp-php5 .php
                      AddHandler x-mapp-php5 .php

                      ############################################
                      ## default index file

                      DirectoryIndex index.php

                      <IfModule mod_php5.c>

                      ############################################
                      ## adjust memory limit

                      # php_value memory_limit 64M
                      php_value memory_limit 128M
                      php_value max_execution_time 18000

                      ############################################
                      ## disable magic quotes for php request vars

                      php_flag magic_quotes_gpc off

                      ############################################
                      ## disable automatic session start
                      ## before autoload was initialized

                      php_flag session.auto_start off

                      ############################################
                      ## enable resulting html compression

                      php_flag zlib.output_compression on

                      ###########################################
                      # disable user agent verification to not break multiple image upload

                      # php_flag suhosin.session.cryptua off

                      ###########################################
                      # turn off compatibility with PHP4 when dealing with objects

                      php_flag zend.ze1_compatibility_mode Off

                      </IfModule>

                      <IfModule mod_security.c>
                      ###########################################
                      # disable POST processing to not break multiple image upload

                      SecFilterEngine Off
                      SecFilterScanPOST Off
                      </IfModule>

                      <IfModule mod_deflate.c>

                      ############################################
                      ## enable apache served files compression
                      ## http://developer.yahoo.com/performance/rules.html#gzip

                      # Insert filter
                      #SetOutputFilter DEFLATE

                      # Netscape 4.x has some problems...
                      #BrowserMatch ^Mozilla/4 gzip-only-text/html

                      # Netscape 4.06-4.08 have some more problems
                      #BrowserMatch ^Mozilla/4\.0[678] no-gzip

                      # MSIE masquerades as Netscape, but it is fine
                      #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
                      # Don’t compress images
                      #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

                      # Make sure proxies don’t deliver the wrong content
                      # Header append Vary User-Agent env=!dont-vary

                      </IfModule>

                      <IfModule mod_ssl.c>

                      ############################################
                      ## make HTTPS env vars available for CGI mode

                      SSLOptions StdEnvVars

                      </IfModule>

                      <IfModule mod_rewrite.c>

                      ############################################
                      ## enable rewrites

                      Options +FollowSymLinks
                      RewriteEngine on
                      RewriteBase /
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteCond %{SERVER_PORT} 80
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteCond %{SERVER_PORT} 443
                      # RewriteRule ^(.*)$ ~sitefolder/index.php?q=$1 [L,QSA]

                      ############################################
                      ## you can put here your designart root folder
                      ## path relative to web root

                      # RewriteBase /sitefolder

                      ############################################
                      ## workaround for HTTP authorization
                      ## in CGI environment

                      # RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

                      ############################################
                      ## always send 404 on missing files in these folders

                      # RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

                      ############################################
                      ## never rewrite for existing files, directories and links

                      # RewriteCond %{REQUEST_FILENAME} !-f
                      # RewriteCond %{REQUEST_FILENAME} !-d
                      # RewriteCond %{REQUEST_FILENAME} !-l

                      ############################################
                      ## rewrite everything else to index.php

                      # RewriteRule .* index.php [L]

                      </IfModule>


                      ############################################
                      ## Prevent character encoding issues from server overrides
                      ## If you still have problems, use the second line instead

                      # AddDefaultCharset Off
                      AddDefaultCharset UTF-8

                      <IfModule mod_expires.c>

                      ############################################
                      ## Add default Expires header
                      ## http://developer.yahoo.com/performance/rules.html#expires

                      ExpiresDefault "access plus 1 year"

                      </IfModule>

                      ############################################
                      ## By default allow all access

                      Order allow,deny
                      Allow from all

                      ############################################
                      ## If running in cluster environment, uncomment this
                      ## http://developer.yahoo.com/performance/rules.html#etags

                      #FileETag none
                      ############################################
                      # Mozilla requires this to handle XSL stylesheets
                      AddType application/xml .xsl