We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10090
    • 2 Posts
    I have a php script that sends an email and text message when we get a call through a call tracking phone number. I set up a template page and put the php code on a page using .php extension and works just fine if I put the file in the root folder.

    Why does it work in the root folder but not when I put the snippet in the template and set up a page with .php extension? I don’t get it. Apparently I don’t understand how to use a snippet. Looked everywhere and I just cant get it to work?

    This is the error i get:
    Fatal error: Call to undefined function getformdata() in /home/localvi3/public_html/core/cache/elements/modsnippet/3.include.cache.php on line 12

    Any ideas?
      • 28215
      • 4,149 Posts
      You should paste the code around line 12 of your Snippet with ID 3.

      And make sure that whatever file the ’getformdata()’ method is in is being included.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 10090
        • 2 Posts
        I’m sorry but I have no idea what you mean. A phone call tracking url hits this page with the php code on it. I set to www.mywebsite.com/phone.php&with-a-bunch-of-parameters

        I use a php page with html on it so I can include the Google analytics code on the page to track it as a phone call conversion when its hit.

        I set up the html page from a template and then included the [[!snippet]] in the template.


        Could you please explain in greater detail?