Hey guys, on my website there is a page which pulls some articles from a database, and on that page it displays things like the article, author name, author link etc. the thing is right now the page displays the authors link like www.swiftmediauk.co.uk but we want it to say "View Website". This is the code that pulls that link: if($row['link . $i'] != null) { echo("<a href=\"http://" . $row['link$i'] . "\">" . $row['link$i'] . "</a><br />"); } Code (markup): Can anybody tell me what that line should read to make the link appear as View Website please?
if($row['link . $i'] != null) { echo("<a href=\"http://" . $row['link$i'] . "\">View Website!</a><br />"); } PHP:
Ive just looked at the articles page again and clicked on the "view website" link and for some reason the web address seems to be wrong on all. The url showing is "http:///"... any ideas mate?
$row['link$i'] The variable $i is between single quotes and won't be parsed. So you're basically trying to echo an undefinied variable. Use double quotes instead.