How to detect the current URL?
Drupal's Alias is what your looking for

&lt;?php
$path = drupal_get_path_alias($_GET['q']);
if ($path == 'the/path') {
  // do stuff
}
?&gt;


Others Below:

Full URL

&lt;?php
global $base_root;
$base_root . request_uri()
?&gt;


Drupal's "Internal" URL

&lt;?php
$arg = arg();
// Path of 'node/234' -&gt; $arg[0] == 'node' &amp;&amp; $arg[1] == 234
?&gt;