We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23633
    • 16 Posts
    If i have the same contactform on 20 different pages would it be possible to retrieve the url from which page the form was sent from?
      • 26016
      • 561 Posts
      Hi,
      I know what to do, but not how with FormIt.

      I think you’d just need to get $_SERVER[’REQUEST_URI’] into a hidden variable on the form, and bing bing bada bing.

      Maybe a FormIt expert will chime in. This, btw, is a nice feature to have, I bet the developer will do it! (or maybe it’s already there)

      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 23633
        • 16 Posts
        Do you have an example of how this would be possible to get lets say in subject line?

        Im completely lost when it comes to php and how to integrate this smiley
          • 32316
          • 387 Posts
          You don’t say whether you are using Revo or Evo...
          The following are Revo tags, Evo is similar I’m sure - you can look it up if you need to.
          Either way you do not need any php code.

          You could just use [[*id]] or [[~[[*id]]]] in the form - in a hidden field or whatever - a hidden field might be a good idea so that the user is less likely to mess with this input, used in the subject line of an email as I show below the user might erase ’your’ subject and create their own; do both perhaps.

          [[*id]] would give the id of the form page
          if FURLs are on [[~[[*id]]]] will give you the URL without the base of the form page

          for example
          put this code on the page: mysite.com/contact.html

          <a href="mailto:[email protected]?subject=from-[[~[[*id]]]]">[email protected]</a>


          and when clicked the user will get an email with the subject: from-contact.html
            • 32316
            • 387 Posts
            I’m not thinking clearly here - you are using formit

            if you wanted the page in the subject you alter the subject to this

            &emailSubject=`Some Sucker Bought Another CDO - sent from [[~[[*id]]]]`


            would add the page URL (minus your base URL) - should work... I did not stop and test.

            code borrowed from the formit docs on the modx site
            [[!FormIt?
               &emailTpl=`CentralizedDebtObligationEmailTpl`
               &emailSubject=`Some Sucker Bought Another CDO`
               &emailTo=`[email protected]`
               &emailCC=`[email protected]`
               &emailBCC=`[email protected]`
               &emailBCCName=`CDO Fraud Informant`
            ]]
              • 23633
              • 16 Posts
              Lovely solution whistlemaker smiley
              Cant believe i didnt think to try something like this!

              Yes im currently using revo.
              It works with revo and new formit
                • 23633
                • 16 Posts
                Is there any way to this in eform in evolution btw?

                tried doing it same way as above but no go