Forum Moderators: coopster

Message Too Old, No Replies

Grabbing the URL

         

madmatt69

6:59 pm on Dec 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi everyone,

Configuring a tell a friend form to work with a forum site, and right now I'm using the following string to grab the URL:
<? echo $_SERVER['PHP_SELF'];?>

Which only partially works - It will only grab the "viewtopic.php" and not any of the other parameters that would take someone to a specific post (such as viewtopic.php?p=1767)

Is their another way I can grab the URL that will include the extra variable?

Thanks -
Matt

jatar_k

9:14 pm on Dec 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



there are quite a few different ways to grab the url/path available in $_SERVER [php.net]

try
<? echo $_SERVER['REQUEST_URI'];?>

madmatt69

9:30 pm on Dec 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Works pefect :) Thanks!