# Capturing current URL to variable

**URL:** <https://forum.kirupa.com/t/capturing-current-url-to-variable/164675>\
**Category:** programming\
**Created:** [October 4, 2005, 12:09am UTC](https://forum.kirupa.com/t/capturing-current-url-to-variable/164675 "2005-10-04T00:09:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bodom78](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@Bodom78](https://forum.kirupa.com/u/Bodom78)\
**Post date:** [October 4, 2005, 12:09am UTC](https://forum.kirupa.com/t/capturing-current-url-to-variable/164675/1 "2005-10-04T00:09:19Z")

</div>

Hey guys, I got a simple question if someone has the time to help out.

Basically I want to capture the url variable a visitor has come from. For example I have an index page which will be on several different servers, they all will link back to my page. When the user clicks the link I want to get the URL that they came from and have it in a variable ready for my page to use.

Im guessing PHP would be the way to go but not too sure.

Thanks in advance.
