so today i was writing a php script and i wanted to asign a varialble which was equals to the current url on my browser.

I'm wondering if it's possible to have my PHP get the entire URL from the address bar.

Well you can, using $_SERVER['PHP_SELF']
like this:
CODE:
<?php
echo $_SERVER['PHP_SELF'];
?>


thats ok, but how about if you are mascarading your urls with apache mod rewrite. because whe you do $_SERVER['PHP_SELF'] it will show the complete url but it shows the php file and not my mod_rewrite url.

so if you are wondering if you can get the full url when its masacareded with mod_rewrite, i think that answer would be no. The .htaccess file executed mod_rewrite independantly of php and before the php code is parsed.

Your best bet is to write your code so it will from your rewrite rule. Since you know what the rule is doing, write something like a function to match your rewrite rule in your .htaccess file.

for example, if i were mascarading this url

CODE:
http://www.wallpaperama.com/forums/learn-how-to-get-current-full-url-from-address-bar-show-complete-browser-t1051.html


i wouln't be able to get it with php, but i think you could get it with javascript very easy. now i just have to figure out how to get it from javascript to php.. but that's another post.

Unless someone knows how to do this, i would like to know how you can get it. please help if you do by replying to this post.