Forum Moderators: coopster

Message Too Old, No Replies

Storing current url in a variable

         

kkonline

11:52 am on Sep 2, 2007 (gmt 0)

10+ Year Member



I want to store the current page url in variable $link

I used

$link=$_SERVER['PHP_SELF'];

But it gave me only pages.php if the current link is [url]http://www.example.com/pages.php?catid=1&id=3[/url]

This is required as i am storing the url in a social bookmarking site

What to do?

[edited by: dreamcatcher at 12:05 pm (utc) on Sep. 2, 2007]
[edit reason] Use example.com, thanks. [/edit]

jatar_k

11:55 am on Sep 2, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



take a look at the $_SERVER [php.net] vars and see which one will work for you