cant figure out how to pass a variable

Discussion in 'PHP' started by jezter, Mar 24, 2009.

  1. #1
    Hi All
    First off, this forum has helped me sooooo much so a big thanks is due!!

    My problem is trying to pass a variable from one page to the next.
    The site is like a themed cms. The main index has a header, 3 columns and a footer. The dynamic link to a center column is where the problem is.
    I have created a box on the left column which creates a dynamic menu for a very simple shopping system that should appear in the center column. The code for this box is
    Ok , the menu is displaying the items the way i want and the "index.php?page=store" brings up the empty template in the center column as it should. What i cant figure out is how to pass the variable $row['id'] when i click a menu item. (So i can select where id = $id to display the selected item in the template in the center column)I have tried alsorts of variations but i just dont know how to do it.
    I hope some of you can help me here
    Regards
    Jezter

    PS - I started learning this php stuff abt 6 weeks ago and being the wrong side of 40, its an uphill struggle so go easy on me :)
     
    jezter, Mar 24, 2009 IP
  2. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    use form instead.
     
    javaongsan, Mar 24, 2009 IP
  3. jezter

    jezter Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Its ok , ive figured it out

    <a href="/index.php?page=store&id=<?echo $row['id']; ?>"

    passes the id to the index/store subpage and $_GET in the store subpage gets me the id variable.

    Jester
     
    jezter, Mar 24, 2009 IP