0
$output[] = '<td><IMG SRC="../cart-demo/images/1.jpg" WIDTH="100" HEIGHT="100"></td>';

hi,

i am facing a small problem. can any one hint me or help me with the image property i wanna increase the 1.jpg to 2.jpg and so on..

kindly help

With Regards
danny

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by daneuchar
0

I assume this is in a loop of some description:

$i = 1;

...start loop...

         $output[] = "<td><img src=\"../cart-demo/images/$i.jpg\" width=\"100\" height=\"100\"></td>";
         

         $i = $i + 1;
...end loop...

Note the changes to the html within double quotes.
Use concatenation on variable ($i) if using single quotes.

Edited by diafol: n/a

0

i know it comes in a loop but i am unable to ad it in a loop ... !!

$output[] = '<td><IMG SRC="../cart-demo/images/'.$id.'.jpg" WIDTH="100" HEIGHT="100"></td>';

where $id is the id from mysql database... but this method gives me error.. :(

0
$max_no = 25; //change this

$i = 1;
while($i < $max_no+1){
    $output[] = '<td><IMG SRC="../cart-demo/images/'.$id.'.jpg" WIDTH="100" HEIGHT="100"></td>';
    $i = $i + 1;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.