开发者

how to make url enable and disable for a particular id using php

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 w开发者_StackOverflowould 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!


I would do this:

<div style="display:<?php echo $_GET['id'] == '1234' ? 'block' : 'hidden'; ?>;">
    <!-- Your content -->
</div>


Seems trivial:

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

Please refine the question if you meant something else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜