Forum Moderators: coopster

Message Too Old, No Replies

Capture the current page URL

         

vivek192

6:08 am on Jun 21, 2006 (gmt 0)

10+ Year Member



Hai,

I Have to capture the current page URL and send that page as a link to my friend, can anyone guide me how to do it, or tell me whether any sample script available for this.

Vivek

vincevincevince

7:09 am on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try these:

<?php
print $_SERVER[REQUEST_URI];
?>


<?php
print $_SERVER[HTTP_HOST];
?>

proper_bo

9:27 am on Jun 21, 2006 (gmt 0)

10+ Year Member



I would use $_SERVER[HTTP_HOST] and $_SERVER[REQUEST_URI] to get the url and then us the php mail function to email the information.
?>

FiRe

10:18 am on Jun 21, 2006 (gmt 0)

10+ Year Member



<textarea name="message">
Hey check out this link: <? echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
</textarea>

eelixduppy

12:21 pm on Jun 21, 2006 (gmt 0)



As for sending it via mail, here are some places to look for information:

Good luck ;)