Jump to content

better way of putting php inside img tag


darkfreaks

Recommended Posts

got another problem i tried to rewrite it inside an echo like barand suggested getting errrors

 

<? echo"<td><a href="" onClick="MM_swapImage('Limage','','../cms/models/content/'.$modelID.'/'{.$image[3].}'',1)">
<img src='../cms/models/content/".$modelID."/"{.$image[3].}"' width="70" height="116" border="0"></a></td>"; ?>

You are trying to use " inside a string already enclosed by ""s. Either escape them (\") or substitute single quotes eg

 

<?php
echo"<td><a href='' onClick=\"MM_swapImage('Limage','','../cms/models/content/$modelID/{$image[3]}',1)\">
<img src='../cms/models/content/$modelID/{$image[3]}' width='70' height='116' border='0'></a></td>"; 
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.