Question: > 
> **Possible Duplicate:**  
> 
> [How to get URL of current page in PHP](https://stackoverflow.com/questions/1283327/how-to-get-url-of-current-page-in-php) 
> 
> 
> 

ive been searching all over and i do not know php too well but all im trying to to do is display:none in php when on a certain page (/site/page/).

**basically** `<?php if on this page -->(/page/site/)><?php //echo $this->?><div or span id="dropdown_navigation" style="display:none"></div> <?php endif; ?>`

i know that code is all funky but i just wanted to kinda explain what im trying to do in that made up code with no php knowledge. the div id im trying to hide when on a certain page is a drop down menu called **"dropdown\_navigation"**

any help would be greatly appreciated.

thanks.

Answer: 
Alright. You can go like so:

```
<?php if($_SERVER['REQUEST_URI']=='/the/page.html'){
echo '<div id="dropdown_navigation"...';
} ?>

```

That should do it. Replace ... with whatever you need. If you need to use a single quote in there, you'll have to escape it by prepending a backslash (i.e. \')

This only works with the relative URL.
There are two global arrays which contain the information about the url:

1. `$_SERVER['REQUEST_URI']` :
2. `$_SERVER['QUERY_STRING']` : This will contain the query string something after the ? in the url.

The PHP script would be then :

```
<?php
if($_SERVER['REQUEST_URI'] == 'your specific page url') {
 ?>   
<div or span id="dropdown_navigation" style="display:none"></div>

<?php }  ?>

```