# GET\_variable and javascript

**URL:** <https://forum.kirupa.com/t/get-variable-and-javascript/153795>\
**Category:** programming\
**Created:** [July 4, 2005, 7:43pm UTC](https://forum.kirupa.com/t/get-variable-and-javascript/153795 "2005-07-04T19:43:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphaeld](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@raphaeld](https://forum.kirupa.com/u/raphaeld)\
**Post date:** [July 4, 2005, 7:43pm UTC](https://forum.kirupa.com/t/get-variable-and-javascript/153795/1 "2005-07-04T19:43:20Z")

</div>

I’m working with a while-loop that generates links  
The while-loop generates this:

```
                   [left]             

```

```php
   echo "<a href=\"javascript:PopupPic('".$bestandsnaam."')\">" 
echo "<img src='".$bestandsnaam."' border='0' height='60'>"  

```

[color=#000000][color=#cc0000]  
[/color] [/color] [/left]

I would like to set a GET\_variable, the variable is an id ,  
but the id is generated together with the links in a while loop.  
Because each link has a unique id I would like the unique id to be appended somewhere in it’s appropriate link.

when the link is clicked a piece of javascript code is executed:  
[left]

```auto
<script language="Javascript"> function PopupPic(sPicURL) { window.open( "../../lib/php/popup.inc.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200"); } 

```

[/left]

I don’t want the id appended in this piece of code:  
When the id is appended in this code, the value of the id is the last value that came out the while-loop and that’s not what I need.

Any clue?
