Page 1 of 1

clever weblink??

Posted: Sun Apr 13, 2003 11:16 am
by josboogz
Hi all,

I currently store a titles of books in one of my mysql tables and was wondering if is possible to ouput the data as a link. But the link would redirect the user to the product page of that book of a bookshop website like amazon or blackwells. So the the title would be automatically entered in the search field of the bookshop website. I would like it to be dynamically done like this since the title of books can change.

Thanks for your time,

José

Posted: Sun Apr 13, 2003 12:05 pm
by McGruff
Have you examined the format of Amazon's links? For example, do they use a product ID? If so you wouldn't be able to predict what that would be and so you couldn't create dynamic links.

If they used just the book name it might be possible to create a link something like:

$link = '<a href="' . first_part_of_link . $book_name . $last_bit . '">';

..but if your book name doesn't match theirs (forgetting a "the" or an alternative spelling like "color" instead of "colour") the link wouldn't work.

If they have some kind of downloadable book catalogue you could get that, import the data into your mysql database and generate dynamic links with this. If they don't, maybe they'd be amenable to setting it up: wouldn't be hard to do and is useful free marketing for them if lots of sites were to use the data to link to Amazon.

email them

Posted: Sun Apr 13, 2003 3:41 pm
by phpScott
Why not just emai amazon or however to find out if the have a service that already allows people to do this.
I did a quick search of they're site but didn't find anything obvious.

phpScott