WordPress.org

Ready to get started?Download WordPress

Forums

Help with ?= variables (4 posts)

  1. mealtog
    Member
    Posted 7 years ago #

    Here is my page:

    http://www.domain.com/index.php/contact/

    I want to trigger a thank you message when a user signs up to a newsletter on the same page using an ?f= variable like so:

    http://www.domain.com/index.php/contact/?f=yes

    I want the than you message to come up if the URL has an f-value. How come wordpress can't recognize these?

    http://www.domain.com/index.php/contact/?f=yes
    http://www.domain.com/index.php/contact?f=yes

    Any ideas on how I can make this work?

  2. Jon Bourne
    Member
    Posted 7 years ago #

    <?php if(isset($_GET['f']) && $_GET['f']=='yes') : ?>

    <p class="thank-you">Thank you for signing up for our newsletter.</p>

    <?php endif; ?>

  3. Kafkaesqui

    Posted 7 years ago #

  4. mealtog
    Member
    Posted 7 years ago #

    Fantastic. That helped alot. It's all good now.

Topic Closed

This topic has been closed to new replies.

About this Topic