Dynamic links with parameters

Hello!

I'm with a doubt. I would like to create an external file to the menu of a site that is in charge of making the link between the pages, but I have a lot of difficulty in the execution. I'm starting with PHP now …

For example:

My menu has:

home
About us
texts
Contact

In the r.php file I am using the superglobal $ _GET to collect that information:

<? Php
$ link = $ _GET['codigo'];
("./ index.php", "./ who / index.php", "./ texts / index.php", "./ contact / index.php");

(& # 39; location: & # 39 ;. $ in the direction[$link]);

?>

The first one works, because the r.php file is in the root folder, next to the first index.php. The others can not find the file and I have difficulties doing it.

I had read that the & # 39; ./& # 39; it does the search from the root folder of the application, but it is not working. Any advice?

I thank you already.