Access POST data to conditionally display form I'm working with the contact form plugin and would like to test for post data to see if the form was just submitted.

It seems this code always throws a template error.

Variable "test" does not exist


Is there a better way to do this?

{% set success = craft.request.getPost(test) %}
{% if success %}
    form was just submitted
{% endif %}
I think you want this:

{% set success = craft.request.getPost('test') %}
{% if success %}form was just submitted{% endif %}


Pass a string to getPost()