...

View Full Version : Show/Hide <div> depending on post variable



imShack
11-05-2009, 12:34 AM
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

Fumigator
11-05-2009, 04:35 PM
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:



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.

imShack
11-05-2009, 05:06 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum