We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 727
    • 502 Posts
    OK, I see now. I need to restore the session data to the fields hash in the beforeParseFunction. Thanks.

    Andy
      • 727
      • 502 Posts
      I’m having a problem getting eform to work with latin1 characters when using multiple "pages". If I create a simple form that sends an email, and enter "Öffentlich", then everything works ok. However, try this:

      1. Cut and paste the chunks, snippet and eform call from the first post in this thread.

      2. Edit the multiFormFunctions snippet and add the following just before the break under case 3 inside the beforeMailSentFunction:

      $log = fopen("/tmp/gdform.log", "a");
      fwrite($log, "Name = ".$fields['name']."\n");


      I.e. case 3 will look like:

      case 3://last form
      //from here we go to the report so we need to restore previous values
      // into the fields array so they can be used in the report
      $fields['name'] = $_SESSION['name'];
      $fields['email'] = $_SESSION['email'];
      $fields['address'] = $_SESSION['address'];
      $fields['town'] = $_SESSION['town'];
      
      $log = fopen("/tmp/gdform.log", "a");
      fwrite($log, "Name = ".$fields['name']."\n");
      
      return true; //return now and let eForm do it's thing


      3. Submit the form, and enter "Öffentlich" for the name in the first step.

      4. Look at /tmp/gdform.log. The "Ö" has been corrupted to a "Ã" like so:

      Name = Ãffentlich


      However the weird thing is that the report on the screen in my web browser shows:

      Name   Öffentlich


      So even though it is displaying correctly, the string in the PHP script is not actually correct. It is corrupted.

      Any ideas? This one is driving me nuts and I need to be able to support German in my forms.

      Andy
        • 727
        • 502 Posts
        Was anyone else able to reproduce the problem using the steps I described?

        Andy
          • 727
          • 502 Posts
          Update: I tested this on a different linux server running a different version of Linux (Debian), and it did the same thing. So this appears to be a MODx/eform issue. sad

          Andy
            • 27376
            • 576 Posts
            The issue is the file encodings are different between the file and the webpage. You’ll need to match the encoding on either the file or the webpage. I think MODx can change this but I don’t remember where.
              • 727
              • 502 Posts
              Thanks! It seems my latin1 problem is elsewhere and the log file idea to try and pin it down confused me.

              Andy
                • 29076
                • 615 Posts
                This is just a suggestion, I don’t know if it can be to any help: Have a little look on this form-generator. It’s made for Joomla/Mambo, but maybe it have ideas that can be used here as well. rolleyes Specially when it comes to a form on several pages.
                  I think, thererfor I am! But what I am, and why...?
                • LOL ... ask Jason (Opengeek) about facileforms and the recent Mambo conversion he’s doing. wink

                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • I don’t want to comment much (yet), but I certainly will not be looking to that project for inspiration (no offense intended at all to you Sylvaticus). I created xPDO, so tools like MakeForm and MakeTable could be extended to handle these things in a much more efficient, maintainable, and MODx-like way. You’ll see more advanced features in these areas in the future...
                    • Just to clarify, Jason did have some major problems with that form solution including both performance and security, so he’s not having a not-invented-here syndrome moment. wink
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me