# PHP: Composing links for menu items

**URL:** <https://forum.kirupa.com/t/php-composing-links-for-menu-items/242904>\
**Category:** programming\
**Created:** [October 31, 2007, 3:44pm UTC](https://forum.kirupa.com/t/php-composing-links-for-menu-items/242904 "2007-10-31T15:44:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armored](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@Armored](https://forum.kirupa.com/u/Armored)\
**Post date:** [October 31, 2007, 3:44pm UTC](https://forum.kirupa.com/t/php-composing-links-for-menu-items/242904/1 "2007-10-31T15:44:23Z")

</div>

[FONT=Arial][SIZE=2]Hi,[/SIZE][/FONT]

[FONT=Arial][SIZE=2]I have put together a frame for my pages where I have a fixed header, footer and menu. The page is called index.php. Now, I would like to use this page frame and load different content into the content area when o menu item is clicked.[/SIZE][/FONT]

[FONT=Arial][SIZE=2]I figured out I would like to have something like:[/SIZE][/FONT]

[FONT=Arial][SIZE=2]index.php or index.php?id=0 =\> loads the homepage  
index.php?id=1 =\> loads the page linked to by the first menu item  
index.php?id=2 =\> loads the page linked to by the second menu item[/SIZE][/FONT]

[FONT=Arial][SIZE=2]and os on…[/SIZE][/FONT]

[FONT=Arial][SIZE=2]Now, my question is what is the best way to compose the links for the menu items so that the id=xx value appeares in the URL and that I can extract this information afterwards (using HTTP\_GET\_VARS maybe?).[/SIZE][/FONT]

[FONT=Arial][SIZE=2]As you can tell easily tell, I’m a beginner at this.[/SIZE][/FONT]

[FONT=Arial][SIZE=2]Many thanks in advance![/SIZE][/FONT]
