We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30636
    • 22 Posts
    Hi all,

    I have the following problem , which I’m unable to fix. Can any one fix this out.

    I have written a snippet containing some PHP code. I have created a new document and placed the before created snippet tag. The new document is for only logged in users.

    The snippet I have created contains a HTML FORM which submits the data and redirect to the home page.

    But , When I Login and see the page it is not displayed in the body area of the site , instead displayed right side top side. When I view the SOURCE Code of the HTML page , The snippet code is displayed before <html> tag. Also , for a request to this page, it showed me "Uh oh ... it’s a 404! (Page Not Found)" page. How can It be 404 if the document is still existing. and shown.

    How can I fix this so that this snippet code is displayed like other pages at the body of the template.

    Please help me in advance,

    Thanks in advance.
    -


      • 10487 MODX Staff
      • 1,535 Posts
      When I Login and see the page it is not displayed in the body area of the site , instead displayed right side top side. When I view the SOURCE Code of the HTML page , The snippet code is displayed before <html> tag.
      If you are using echo in the snippet then that will be the problem, capture the output in the snippet into a variable and then use return to return the output variable to the page.

        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com