tml Posted October 2, 2008 Share Posted October 2, 2008 i have a code that works to get a picture from my db: echo "<img src='" . $row["sti"] . "' class='foto'/>"; my problem are to make it a link so it open the same picture but in larger view, i have tryid abit and this are what i could think of so fair echo "<a href='" . $row["stilarge"] . "'><img src='" . $row["sti"] . "' class='foto'/>"</a>; but i wont work, i have 3 table, 1 id one, one url like pic/1.jpg(sti) and the last for the large pic (stilarge) so all i need is the link where it select same id but the large picture. needs to open in same window not like target_new Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted October 2, 2008 Share Posted October 2, 2008 assuming you have the rows right echo "<a href='{$row["stilarge"]}'><img src='{$row["sti"]}' class='foto' /></a>"; should work... what do you mean when you said "but it wont work" what is it doing that you say it isn't working? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 2, 2008 Share Posted October 2, 2008 If you want it in place of the smaller image, you could try this: echo "<img onclick=\"this.src='$row["stilarge"]'\" src='" . $row["sti"] . "' class='foto'/>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.