Forum Moderators: coopster

Message Too Old, No Replies

Getting the Current URL

         

vls_jr

10:59 am on Jan 14, 2005 (gmt 0)

10+ Year Member



Hey folks, I have a little problem and I know PHP can solve it. I want to create a bookmark that jumps to the bottom of the page but it's not working because the current URL needs to be generated.

Here's what I have.

<span class="author"><a href="#about">
<?php echo $by. ' '.( $row->created_by_alias? $row->created_by_alias : $row->author );?></a>
</span>

I want to insert the current web page URL right before the #about bookmark.

Thanks!

coopster

11:50 am on Jan 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, vls_jr.

PHP has $_SERVER [php.net] variables that you'll want to check out.

<span class="author"><a href="<?php print $_SERVER['REQUEST_URI']; ?>#about">

vls_jr

12:00 pm on Jan 14, 2005 (gmt 0)

10+ Year Member



Thanks!