# Calling the URL using HTML, PHP or JavaScript



## Jayso

Hello there, does anybody know how to call the URL from a website using HTML, JavaScript, or PHP? I'm sure that it is quite easy, in fact i remember using a javascript code that did so ages ago...

Thanks for your help


----------



## DumberDrummer

Call the URL? Like create a link?

Or find the link of the referrer, to tell where they came from?


----------



## Jayso

Call the URL.

As in if the site was located at www.test.com/test/index.php, then it would be able to do something with www.test.com/test/index.php (for example display a JavaScript alert with this, or print the URL)


----------



## DumberDrummer

would something like this work? You can modify it to your purposes:

http://www.codeave.com/javascript/code.asp?u_log=7020


----------



## Jayso

Sounds alright, i'm d/l updates for the linux system at the moment so i can't test it out till thats done

Thanks for your help though mate


----------



## DumberDrummer

no problem. Let me know if that doesn't work, and I'll find something else.


----------



## Jayso

yep, exactly what i was looking for, thanks


----------



## Jayso

Actually after stuffing around with virtual hosts and installing different versions of php on both and running the phpinfo() command to test, i actually found a better way of doing this (using PHP)



PHP:


<?php 
	$a = $_SERVER['REQUEST_URI'];
	print $a;
?>

Still thanks for your help, i now have two ways to do this!


----------



## Grove

Thanks for sharing the other way with us. I know this will help future programmers.


----------

