Jump to content

Can an image be interted in here??


roldahayes

Recommended Posts

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>&pound$price</td>

    <td>&pound$priceVAT</td>

  </tr>\n";



}



?>

Link to comment
https://forums.phpfreaks.com/topic/76365-can-an-image-be-interted-in-here/
Share on other sites

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.