We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19636
    • 29 Posts
      • 9585
      • 50 Posts
      This looks like a really great module...brilliant work

      Danny
        • 26016
        • 561 Posts
        Hi,
        Wow, just tried this today. It’s extremely promising... thank you!!!!! Having spent many hours with the very capable yet tricky Eform, this is an exciting development.

        I have one thing to pass along - when I test forms I typically include some apostrophes and/or quotes just to be on the safe side. I did a text field with validation, and when I typed "It’s great" with its apostrophe (’) in it, I got an SQL error. I then took the apostrophe out, and it all worked fine.

        Interestingly, the email did send fine both ways; it seems to have been a problem only in the "save to database" function.

        I’m thinking it may be the standard stripslashes or addslashes type of deal. If I have time, I might try to find the spot.

        Good stuff!
        Dave
          MODx and Wordpress development
          Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
          • 19636
          • 29 Posts
          I will look at this. Thanks for helpful advise.
            • 19636
            • 29 Posts
              • 26016
              • 561 Posts
              Hey Ministry, wow, you’re fast!
              I downloaded that, and did a few more tests.... as before, the email always gets through. I tried a number of quote and apostrophe formats.

              This type of thing worked great, using double-quotes:
              this is "hot" is it not?

              Single-quotes still seem to be having some trouble. These errored:
              this is ’nifty’ give me fifty
              "This is so ’cool’, I’ll take it!"

              I’m wondering if maybe another change might be needed, or if the archive maybe didn’t get updated properly?

              Thanks! Dave
                MODx and Wordpress development
                Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
                • 19636
                • 29 Posts
                I tested with a single quote and it worked on my machine.

                Please clear cache. I am inserting my code. Maybe you can look and see if you have suggestions on what I should do differently.
                    foreach($_POST as $key => $val){
                         if (is_array($val)){
                            $msg.="Item: $key\n";
                            foreach($val as $v){
                               $v = stripslashes($v);
                               $msg.="   $v\n";
                            }
                         } else {
                            $val = stripslashes($val);
                            $msg.="$key: $val\n";
                         }
                      }
                      $cleanmsg = addslashes($msg);
                      $from = $sender;
                      $recipient= $to;
                      $subject="Form submission";
                      $headers = "From: $from\r\n";
                      error_reporting(0);
                      if (mail($recipient, $subject, $msg, $headers)){
                         echo "<p>".$message."</p>\n";
                         echo nl2br($input);
                         $fields = array(
                	'`formid`' => $formid,
                	'`ip`' => $ip,
                	'`message`' => $cleanmsg,
                	);
                	$modx->db->insert( $fields, "formbuilder_submissions");
                	echo 'Message Logged in database!';

                  • 26016
                  • 561 Posts
                  Hi,
                  That did it, my friend... working beautifully now!

                  Ministry CRM is simply awesome, and fast! Hire this guy! smiley

                  Thanks! Dave
                    MODx and Wordpress development
                    Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
                    • 19636
                    • 29 Posts
                    HEHE, Thanks wink
                      • 26016
                      • 561 Posts
                      Hi,
                      I’ve been testing this some more. I was able to create checkboxes, selects, and radio buttons, which was great! I am also making a habit of doing a forced refresh of the browser when I make a change to make sure they go into effect. Some suggestions, if I may...

                      I seem to be having trouble getting checkboxes and radio buttons to work as "required". Did those work for you?

                      When I go to "Edit Advanced Form Options" and change Form Description, it doesn’t seem to save that field.

                      I wonder if on the "Edit Advanced Form Options" page, there might be a "back" type of button. Right now I guess it’s best to just click "Submit" even when not making a change.

                      Thanks! Dave



                        MODx and Wordpress development
                        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4