SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php (hyperlinking)

    I am creating a database of book summaries. I visualise access to the database through the web browser as follows:

    On the main page there are four subject categories to pick from. When the user clicks on a category they are taken to a page of titles of all summaries available in that category. When they click on a title they are taken to that individual summary.

    My question is how do I trun the retieved plain text into hyperlinks that point to the individual summary.

    Daniela

  2. #2
    SitePoint Zealot LiamW's Avatar
    Join Date
    Mar 2003
    Location
    Hamilton, Ontario
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well do you know how you are going to perfrom the query on the database?

    Basically you'd have some sort of id for each book and make the link go www.site.com/page.php?bookid=1 and so on.

    You would loop through each id in the database and print a link like above.

    so for a quick example if you were using mysql

    while($row = mysql_fetch_array($result))
    {
    $id = $row['bookid'];
    $name = $row['name'];
    echo "<a href=\"page.php?bookid=$id\">$name</a>";
    }

    Like I said this was a quick and dirty example.
    If you need more help or for one of us to go more in depth just ask


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
  •