Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The $_GET challenge

    In my code I would like to append a $_GET)-variable (an id) to a link.
    the variable looks like this
    PHP Code:
    id='".$id."' 
    this shoud be appended to a link. When the link is clicked the next page can get the id out of the url.
    The links and the id's are generated with a while-loop.
    The while-loop generates this:


    PHP Code:
    echo "<a href=\"javascript:PopupPic('".$bestandsnaam."')\">"
    echo "<img src='".$bestandsnaam."' border='0' height='60'></a>" 
    Because each link has a unique id I would like the unique id to be appended somewhere in it's appropriate link. The problem that the link refers to a javascript somewhere in the code. You can check the javascript here:

    Code:
    <script language="Javascript"> function PopupPic(sPicURL) { window.open( "../../lib/php/popup.inc.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200"); } </script>
    I don't want the id appended in this piece of javascript-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.
    So I need the id to be in the link generated by the while-loop

    Can somebody help me with the issue.

  • #2
    Regular Coder
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post
    if you want the unique id of each value through the loop then you need to place the link inside the loop itself so that when you loop through it will display the link with the apropriate ID for each set of values. i hope this is what u mean as it was a little hard to understand

  • #3
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks a lot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •