roldahayes Posted November 7, 2007 Share Posted November 7, 2007 Hi there, been playing with some code over the last few days and have a question. The code displays a list of results from a csv file and lists them fine, however, can an image header be somhow inserted to split the reults upinto 3 sections? <?php $odd = '#cccccc'; $even = '#999999'; $products = file('./csv/berlingo.csv'); foreach($products as $i => $product_info) { list($product_code, $description, $price, $priceVAT, $thumb, $image) = explode(',', $product_info); list($w, $h) = getimagesize($thumb); $url= "window.open('$image','image','left=20,top=20,width=592,height=505,toolbar=0,resizable=0');"; $image = "<a href=\"javascript:void(0);\" onclick=\"$url\"><img src=\"$thumb\" border=\"0\" alt=\"Click For More Info\" width=\"$w\" height=\"$h\" /></a>"; $bg = ($i%2) ? $odd : $even; echo " <tr style=\"background-color:$bg\"> <td>$image</td> <td>$product_code</td> <td align=\"left\">$description</td> <td>£$price</td> <td>£$priceVAT</td> </tr>\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/76365-can-an-image-be-interted-in-here/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.