Please can somebody help with this. I want a Buy Now image to go to the producturl in the database, at the moment I am just echoing , so it only shows the text of the url in the cell.

my code currently is

echo $row['ProductUrl'];
	echo "</td></tr>";

Hope somebody can help as it is driving me mad..... newbies hey!!!!!

Recommended Answers

All 3 Replies

Assuming your image is located at http://www.yoursite.com/Images/buyNow.gif, then try:

echo sprintf( '<a href="%s"><img src="%s"/></a>', $row['ProductUrl'], '/Images/buyNow.gif' );
	echo "</td></tr>";

thanks alot that seems to have sorted it. Thanks again

You are welcome! Be sure to mark the question as solved.

Regards,
Hielo

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.