Can you use conditional based on a referring URL?

Forums General Can you use conditional based on a referring URL?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #630
    Carole Asselin
    Participant

    I have NO idea if it is feasible, but if s2M uses so many conditionals and is so powerful, i am wondering if it is possible to display content based on what link the user comes from.

    I plan on having a “poll” question leading to a single page but with different tags in the URL. That will allow me to track the clicks on Active Campaign, but i thought that MAYBE, i could conditionally show a different response to them clicking on the link and answering the poll.

    Is that possible or am i just dreaming in IMAX?

    #631

    You could with some PHP. WP Admin -> s2Member -> Restrictions -> Shortcode Conditionals -> PHP

    E.g.

    [s2If php="isset($_REQUEST['answer']) && $_REQUEST['answer'] == '1'"]
    You answered "1".
    [/s2If]
    
    #632
    Carole Asselin
    Participant

    Hum… not sure if i should be happy (that it is possible) or scared (that i have NO CLUE what that code is about!)
    I’ll have a look further, but you are giving me hope that something really interesting can be done to customize user experience!

    #633

    🙂

    Well, when you send a variable to the next page, it can be either through the URL ($_GET) or a submitted form ($_POST). See:

    http://php.net/manual/en/reserved.variables.get.php
    http://php.net/manual/en/reserved.variables.post.php
    http://php.net/manual/en/reserved.variables.request.php

    I hope that helps!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.