Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 27th Aug 2010, 05:48 AM   #1
JW
War Room Member
 
John Webster's Avatar
 
Join Date: 2010
Location: Sweden & Denmark
Posts: 20
Thanks: 2
Thanked 2 Times in 1 Post
Lightbulb
Hide/unhide div based on URL
Share on: 
fb share twitter share gplus share more share

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 root domain etc. test.com/index.php

If visitors are on any other url the "div" should be hidden. (Including test.com/index.php”?something-extra-here”)

How can this be achieved in PHP/JavaScript?

Any ideas? Any help is appreciated

Thanks in advance!

John Webster is offline  
Unread 27th Aug 2010, 08:41 AM   #2
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Hide/unhide div based on URL
Share on: 
fb share twitter share gplus share more share

Check the PHP $_SERVER['REQUEST_URI'] and $_SERVER['QUERY_STRING'] superglobals.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
The Following User Says Thank You to SteveJohnson For This Useful Post:
Unread 27th Aug 2010, 08:41 PM   #3
JW
War Room Member
 
John Webster's Avatar
 
Join Date: 2010
Location: Sweden & Denmark
Posts: 20
Thanks: 2
Thanked 2 Times in 1 Post
Default
Re: Hide/unhide div based on URL
Share on: 
fb share twitter share gplus share more share

Thanks that helped me in the right direction :-)

John Webster is offline  
Unread 28th Aug 2010, 04:17 AM   #4
Active Warrior
 
Join Date: 2010
Posts: 88
Thanks: 1
Thanked 3 Times in 3 Posts
Default
Re: Hide/unhide div based on URL
Share on: 
fb share twitter share gplus share more share

Yes you can use query string to hide or show any div.
or use document.href in javascript
zeeshi570 is offline  
Closed Thread


Bookmarks

Tags
based, div, hide or unhide, hide/unhide div, url


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:11 AM.