SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    cioa
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using links in queries

    Hi, I was wondering if anyone could help me figure out a way to load up a php page from a user clicking on a link that changes depending on a query.

    Maybe if I fill you in on what I have done,so far it will make more sense. Right now I have a search form page that allows users to make searches, once the search is completed a list of links appears(depending on the search). I'm trying to make it so when a user clicks on a link from the list, data corresponding to that link will load up in a new page.

    Could someone please help me with this, or point me in the right direction, Thanks.

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have all the links link to the same php page using a unique url parameter.
    E.g
    <a href="view.php?id=1">foo</a>
    <a href="view.php?id=2">bar</a>
    <a href="view.php?id=3">whatever</a>

    where the id is unique and is a value from your database.

    view.php can then use $_GET['id'] to query the db for the data relating to that id and display the info.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    cioa
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should I make a new database field, or use the autonumber field for the id values? Thanks for the help.

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The autoincrement value is fine as it's unique.


Bookmarks

Posting Permissions

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