# Passing and Using a variable on subsequent page

**URL:** https://forum.kirupa.com/t/passing-and-using-a-variable-on-subsequent-page/67894
**Category:** programming
**Created:** [October 20, 2004, 2:46pm UTC](https://forum.kirupa.com/t/passing-and-using-a-variable-on-subsequent-page/67894 "2004-10-20T14:46:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![GFX\_Wiz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gfx_wiz/32/815_2.png) [@GFX\_Wiz](https://forum.kirupa.com/u/GFX_Wiz)
#### Post date: [October 20, 2004, 2:46pm UTC](https://forum.kirupa.com/t/passing-and-using-a-variable-on-subsequent-page/67894/1 "2004-10-20T14:46:57Z")

</div>

OK…this should be a snap for the experienced amongst us (which I am not LOL)…

I am creating an index of links that link to a separate page. On the first page, call it index.php, I am gathering the links by ‘select id, title’ from the database and it is outputting the result to the same page. So now I have a list of links with an id attached to the title of the link.

I have set up the link to go to a new page by linking the output loop to ‘more.php?id=$id’ so no problem there. Everything works as expected with the obvious exception that “more.php?id=$id” results in a blank page…as expected. So here’s my question…

When one of the links is clicked on index.php (linking TO, say, “more.php?id=the\_link\_ID”) how do I use the ‘id’ gathered on the index.php page to query the database on the ‘more.php’ page so I can gather and output the full array of information I have for the link (the id, title, keywords, article, picture and whatever else I have in my table in the DB).

A simplified way to think of this is this message board. On any given page you have a list of topics. When you click on a topic it goes to a new page (I do NOT want to use “$\_SERVER[‘PHP\_SELF’];” !!!) and outputs all the data from the DB related to that thread id.

Does this make sense? LOL I am looking for how to structure the entire query on “more.php” to the DB using the id from the previous page.

```
I sure appreciate any input!!!

GFX.Wiz
(not a coding wiz)
```
