a href tag and PHP session

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imarkdesigns
    New Member
    • Jul 2007
    • 46

    a href tag and PHP session

    good day,
    i have this problem for awhile now and still can't find the answer (wish me luck here right now).

    The concept is to have an anchor link with a value from MYSQL then pulling it out to put it in another page.

    here is my code: (sorry about the code, im begging to the expert, just a newbie here).

    Code:
    <li>&raquo; <a href="listings.php"><?=$rows['title'];?></a> - <?=$rows['city'];?>, <?=$rows['state'];?></li>
    once the title link hits, the value will get and post it to "listings page". code will be like this...
    Search page
    Code:
    <a href="listings.php">List Category 1</a> - City, State
    this will be the outcome instead of the code is correct
    Listings page
    Title: List Category 1
    City: City
    State: State

    **i used to try the PHP session but i seems the last table of MYSQL is always be visible and not the selected category which category has 10 list of it. Hope some one can help me here.. thanks in advance.
  • imarkdesigns
    New Member
    • Jul 2007
    • 46

    #2
    ok, finally... got the answer.. thanks for viewing... haha

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      Not entirely sure I get what you are saying, but. It seems you only need to pass a value via the link to the next page.

      If so, you can simply add the value to the link, and then fetch it via the $_GET super-global.

      That is, if your link looks like so:
      [code=html]
      <a href="page.php? item=someItem"> Some item</a>[/code]
      And your "page.php" page looked like so:
      [code=php]
      <?php
      echo $_GET['item'];
      ?>[/code]
      Once you clicked that link, the "page.php" would print: "someItem".

      Comment

      Working...