PDA

View Full Version : Hyperlink


Thelma
09-04-2002, 04:38 PM
Hi again

i was wondering how I would make a hyperlink from a record I had returned from a search result. Say I want to make the title of a book I had searched for a hyperlink to another page which gives more information about the book.

Any ideas?

mordred
09-04-2002, 07:12 PM
That depends a little on the actual code you employ, but I suspect your book has a certain id to uniquely identify it in your database, file system, intranet, fridge ;) or whatever you where searching in.

Let's asume your book title is stored in the variable $result['title']. I chose this array because in many situations arrays are returned from searches. Printing a link to a "more info" site about this book could look like


echo '<a href="moreInfo.php?book_id=' . $result['id'] . '">' . $result['title'] . '</a>';


Which of course works only if you have actually a $result['id'] that stands for the unique identifier. What happens in return on moreInfo.php is open to you. Or did I misunderstand your question - because usually the search is the more trickier part, not the printing of links?

Thelma
09-06-2002, 01:21 AM
Thanks!

The search wasn't the problem - The hyperlink is what I wanted, I see what you mean about the MoreInfo bit.