Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Show/Hide <div> depending on post variable

    Hello,

    I'm creating a co-registration page and would like to have certain information
    displayed, depending on what form they submitted.

    Example:

    If visitor filled in form A, on the co-reg page, forms B, C and D
    would be displayed

    If visitor filled in form B, then forms A, C and D would display.

    I know how to "show/hide" < div > with text or image links and I also know
    how to use the php GET method to display variables from a URL.

    The "Post Variables" are from Aweber.

    /coreg.php?site=A&name=Name&from=Email

    I have included a hidden variable named "site" in the original form to
    determine where the visitor is coming from.

    I'm trying to figure out how to hide the information that refers to the site
    they just came from.

    Thanks in advance,

    Jeff

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You are generating the html from your PHP script, yes? Simply add an "if" condition for each block to omit that block based on the value of $_GET['site'].

    For example:

    PHP Code:
    if ($_GET['site'] != 'A') {
        echo 
    "<div>this is the site A div</div>";
    }
    if (
    $_GET['site'] != 'B') {
        echo 
    "<div>this is the site B div</div>";
    }
    //etc. 

  • Users who have thanked Fumigator for this post:

    imShack (11-05-2009)

  • #3
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks Fumigator,

    I guess(as I usually do) I was looking to deeply into the task and making it more
    difficult than it needed to be!

    Jeff


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •