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

11-05-2009, 01:34 AM

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


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.


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,


11-05-2009, 05: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>";

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