We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11214
    • 225 Posts
    Quote from: sottwell at Oct 15, 2006, 05:29 AM

    I hacked a copy of eForm to get the data from the SESSION as well as the POST. I added this between the vericode setting and the build form section:
    	// set vericode
    	if($vericode) {
    		$_SESSION['eForm.VeriCode'] = $fields['vericode'] = substr(uniqid(''),-5);
    	}
    
    		# get SESSION data - added by sottwell
    		if(isset($_SESSION['xxxx'] && !empty($_SESSION['xxxx'])) {
    			$value = $_SESSION['xxxx'];
    			$fields[$name] = $value;
    		}
    
    	# build form
    	return formMerge($tpl,$fields);
    }
    

    Add as many as you need.

    I am sorry sottwell, I begin...

    Where do I have to bring in this code? In the snippet?
      Verum Index sui et falsi
      • 30223
      • 1,010 Posts
      Quote from: Dimmy at Oct 19, 2006, 03:25 AM

      maybe add email as tag i search for email in repository but it did not come up

      Good idea... I’m a bit slow ’upstairs’ sometimes :0

      Quote from: grand-mère at Oct 19, 2006, 05:04 AM


      I am sorry sottwell, I begin...

      Where do I have to bring in this code? In the snippet?

      Just download and install 1.4. It’s already in there. See link in post above.
        • 11214
        • 225 Posts
        Thank you TobyL... I indeed have the last version (that of yesterday).

        But by using the form of basic example, I may connect as to webuser, the name and the email are not substituted for both fields..

        Sorry I begin sad

        Is it in the call of the snippet that it is necessary to modify anything?
          Verum Index sui et falsi
          • 11214
          • 225 Posts
          Another question..sorry..

          I try to integrate an Imput File in my form..so in the chunk of the form :

          <P> < Label for = "image" > Your image < / label >
          <input type="file" name="image" enctype="multipart/form-data" size = "40" maxlength = "40" eform = " Your image:image:1 " / >
          < / p >


          And in the two other chunk (Report and Thanks) :

          <tr valign="top"><td>image</td><td>[+image+]</td></tr>

          It works but not really: it shows and send the name of the image, but not the image itself..

          A track for a poor newbie sad ? Thanks

          And if I replace eform = " Your image:image:1 "
          by eform = " Your image:file:1 " (I think that it’s better), I receive nothing more... The field is empty!
            Verum Index sui et falsi
            • 30223
            • 1,010 Posts
            Quote from: grand-mère at Oct 19, 2006, 07:03 AM

            But by using the form of basic example, I may connect as to webuser, the name and the email are not substituted for both fields..

            I’m not quite sure what you’re trying to say. Do you want the name and email of a logged in web user to appear in the form? If that’s the case have a look in this post.

            Quote from: grand-mère at Oct 19, 2006, 08:00 AM

            Another question..sorry..

            I try to integrate an Imput File in my form..so in the chunk of the form :

            <P> < Label for = "image" > Your image < / label >
            <input type="file" name="image" enctype="multipart/form-data" size = "40" maxlength = "40" eform = " Your image:image:1 " / >
            < / p >


            And in the two other chunk (Report and Thanks) :

            <tr valign="top"><td>image</td><td>[+image+]</td></tr>


            Firstly you do not have to set the ’type’ in the eform attribute for file uploads. eForm will figure that out itself. ’image’ is not a datatype eForm recognizes. If you want to make sure that the uploaded file is indeed an image you can test for file extensions like this
            <input type="file" name="image" size="40"  eform=" Your image::1:Not an Image!:#LIST png,jpg,gif " / >


            It works but not really: it shows and send the name of the image, but not the image itself..

            The enctype="multipart/form-data" belongs in the <form ...> tag not in the <input type="file" ..> tag I believe.

            It possibly does send the image but in your report you will only see the image name, not the image itself. That’s normal. eForm is firstly an email generating form. Uploaded files automatically are attached to the email but in the report chunk only the file name would show up. After the email is sent the uploaded file is discarded.

            If you want to do anything else with the uploaded file you could write a function and use the eformOnbeforeMailSent event to store or do somthing else with the uploaded image. (see the eForm documentation in assets/snippets/docs/ for an example using events)

            By the way you have maxlength="40" set for the upload field. As far as I know that’s not a valid attribute for this type of field (not that it hurts I think)
              • 11214
              • 225 Posts
              Thank you very much TobyL... All this is complicated well for a beginner !

              I understand that there are features very evolved in eForm but I would just like to attach a file to the sending of the form.

              Thus, in the chunk of the form, I put this:

              <input type="file" name="image" eform=" Your image:file:1:Not an Image!:#LIST png,jpg,gif " / >


              In the chunk of the Thanks Form and Report Form, i put this :
              <p>your image<[+image+]</p>

              And in my snippet call, i have this :

              [!eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eFeedBackForm` &report=`eFeedBackReport` &thankyou=`eFeedBackThanks` &vericode=`0` &subject=`Web site feedback`!]


              And ?

              The e-mail which I receive contains no attached document!
              What is it thus that I forgot? It is if to complicate to make?

              Sorry to make you waste time... And my English is besides very limited...

              Thank you at least for your help !
                Verum Index sui et falsi
                • 11214
                • 225 Posts
                Do I have to understand that eForm cannot send of accompanying documents? Obviously, it is difficult to believe, even and especially for a beginner...

                Can you help me?
                  Verum Index sui et falsi
                  • 30223
                  • 1,010 Posts
                  The e-mail which I receive contains no attached document!
                  What is it thus that I forgot? It is if to complicate to make?

                  Basically what you have there should be enough to get a file attached to the email. I’m just about to leave for the day but I’ll have a closer look when I get back. Check what version of phpMailer you have (manager/includes/controls/class.phpmailer.php) and make sure it’s the latest one. (altough if you have a recent MODx version I would assume that you have)

                  Do I have to understand that eForm cannot send of accompanying documents? Obviously, it is difficult to believe, even and especially for a beginner...

                  It certainly can...
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    As TobyL said, and if I recall correctly the installation instructions for eForm also say, you should go get the latest version of the phpMailer library. I check from time to time to update my versions, since email is so subject to abuse and they are very good about releasing patched versions to deal with the security issues that come up, as well as fixing any feature bugs.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 11214
                      • 225 Posts
                      Thank you very much to you two, but regrettably, always no attached files!

                      I redid a complete installation of MODx 0.9.5 beta 3 (rev on 1533), installed eForm 1.4, verified the installed phpmailer (Version 1.73-Sun, Jun 10 2005) and i receive the mail, with the fields, but No attached file....Nothing! embarrassed

                      The form :
                      <p><span style="color:#900;">[+validationmessage+]</span></p>
                      <form method="post" action="[~[*id*]~]">
                          <input type="hidden" name="formid" value="feedbackForm" />
                          
                          <p><label accesskey="n" for="Name">Your Name</label>
                          <input type="text" name="Name" maxlength="60"/></p>
                      
                          <p><label accesskey="e" for="email">Your Email Address</label>
                          <input type="text" name="email" size="40" maxlength="40" /></p>
                      
                          <p><label accesskey="e" for="image">Your Image</label>
                          <input type="file" name="image"/></p>
                          
                             
                          <p><input type="submit" name="submit" value="Send Feedback"></p>
                      </form>


                      The report :

                      <p>This is a response sent by [+Name+] using the feedback form on the website. The details of the message follow below:</p>
                      <table>
                      <tr valign="top"><td>Name:</td><td>[+Name+]</td></tr>
                      <tr valign="top"><td>Email:</td><td>[+email+]</td></tr>
                      <tr valign="top"><td>Image :</td><td>[+image+]</td></tr>
                      </table>
                      
                      
                      <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>
                      
                      



                      The Thanks :


                      <h3>Thank you for your feedback</h3>
                      <p>Below is a copy of your message:</p>
                      <table>
                      <tr><td>Your name:</td><td>[+Name+]</td></tr>
                      <tr><td>Your email address</td><td>[+email+]</td></tr>
                      <tr valign="top"><td>Your image</td><td>[+image+]</td></tr>
                      </table>
                      



                      and the call snippet in my page :


                      [!eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eFeedBackForm` &report=`eFeedBackReport` &thankyou=`eFeedBackThanks` &vericode=`0` &subject=`Web site feedback`!]


                      I have to forget something, certainly, but what?

                      I have to clarify you (if it has an importance) that mod_security is activated at my host, and that I have to stick this code in the file .htaccess of my directory manager/ to can install the snippet without problem:

                      <IfModule mod_security.c>
                         # Turn off mod_security filtering. 
                         SecFilterEngine Off
                      
                         # The below probably isn't needed, but better safe than sorry.
                         SecFilterScanPOST Off
                      </IfModule>


                      Would this have a relation with my problem?

                      Has anybody already tested the sending of file attached with eForm?

                      Can he say to me how he proceeds? Thank you for your help.. smiley.

                      I do not know how to make any more :’( :’( :’(




                        Verum Index sui et falsi