WordPress.org

Ready to get started?Download WordPress

Forums

Variable from post to contact form? (2 posts)

  1. plinth
    Member
    Posted 4 years ago #

    What I want is a button in a post that says 'contact us'. That button links to the contact us page where a form field is populated with the slug or ID of the post you've just come from. That field is also repeated in the body of the email sent to the recipient. Is this possible?

    Thanks

  2. Russell Heimlich
    Member
    Posted 4 years ago #

    This can be done with some simple PHP. You can create a hidden field with the value set to whatever you want. When the user submits the form to the contact us page you can grab that value and add it to the page wherever you want using $_REQUEST['nameOfHiddenField'];

Topic Closed

This topic has been closed to new replies.

About this Topic