We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25422
    • 11 Posts
    Is there any way to use the PHP coding inside the chunk?
    • No. You’ll have to make a snippet, then put the snippet tags in the chunk. A chunk is like a mini-template, it can have HTML tags, MODx tags, and text.
        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
        • 25422
        • 11 Posts
        I’ll explain my problem,

        I have a registration form where I have emailaddress field,Here while submitting the form,I need to check whether the email id is already used for registration,if so an alert message should be displayed,else it should be saved in the DB

        So,what i did is,while checking the validation(JS),i diverted to another PHP page and here i checked the availability using sql query,After that i diverted using headr:location where i passed the values"yes" or "no" to the page where the form is.

        So now in the url there will be a variable with value "yes" or "no"

        Now its the time to get the value using $_Get[] inside the chunk,

        But unluckily,PHP codes cannot be used in the Chunk...

        Is there anyway to check the Availability ?
        • Make a snippet to check the GET value and put the snippet tags in the chunk.
            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
            • 25422
            • 11 Posts
            I created a snippet named "emailcheck" and have wrote the necessary coding

            then i called the snippet in the chunk as [[emailcheck]]

            Have i called it in the right way??

            It didn’t work out for me...

            Please help me

            • It probably needs to be called uncached [!...!]
                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