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"; } ?> 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.