user2512457
user2512457

Reputation: 9

Making picture a link to

How can i make this picture a link using this coding format?

if($row['name'] !== "") { 
  echo "<br/><img src='../login/image/";
  echo $row['name'];
  echo "'  style='width: 300px;height: 400px;'>";

Upvotes: 0

Views: 79

Answers (1)

chris85
chris85

Reputation: 23892

You can do it like this, you also don't need all the echos.

if($row['name'] !== "") { 
  echo "<br/><a href='link'><img src='../login/image/" . $row['name'] . "' style='width:300px; height:400px;'></a>";

Upvotes: 1

Related Questions