views:

57

answers:

2

Hi All,

I hope someone in here can help me out because I am a bit confused right now! I have searched everywhere for solutions on this issue but cant find anything...

The question:

I would like to show a specific "div" when and only when visitors are on the particular game is selected. eg: http://www.xyz.com/play.php?id=1234

If visitors are on any other url the "div" should be hidden. (Including http://www.xyz.com/play.php?id=....)

How can this be achieved in PHP/JavaScript?

Any ideas? Any help is appreciated

Thanks in advance!

A: 

Seems trivial:

if ($_GET['id'] == $magic_value) { /* display the div */ }

Please refine the question if you meant something else.

viraptor
+1  A: 

I would do this:

<div style="display:<?php echo $_GET['id'] == '1234' ? 'block' : 'hidden'; ?>;">
    <!-- Your content -->
</div>
captaintokyo
Hi Thanks captaintokyo, it worked for me...great work..
phphunger