Hi@all!
I would like to show personalized pictures. This pictures are shown in an email. In my mysql there is one field for every recipient in it there is a car brand like BWM, Volvo, VW and so on. I want that every recipient gets the picture from his brand. But there are around 80 brands and I don´t want to write all the lines for every brand, I would like to do this automatically even I would need such a code for other personalization with a lot more than 80 pictures.
In the Email there is the img tag: <img src="http://www.mysite.com/brand.php?Brand=%Member:CustomField1%"> where %Member:CustomField1% is the brand
With this code it´s working:
<?php
$Brand = $_GET['Brand'];
if ($Brand == 'VW')
{
$fp = fopen('./images/logo_VW.gif', 'rb');
}
elseif ($Brand == 'Volvo')
{
$fp = fopen('./images/logo_Volvo.gif', 'rb');
}
else
{
$fp = fopen('./images/logo_generic.gif', 'rb');
}
header('Content-type: image/gif');
fpassthru($fp);
fclose($fp);
exit;
?>
but like described above I don´t want to write every brand, so I got a code from a friend, but it´s not working - what is wrong?
<?php
$Brand = $_GET['Brand'];
$fp = fopen('./images/logo_'.strtolower($Brand).'.gif', 'rb');
header('Content-type: image/gif');
fpassthru($fp);
fclose($fp);
?>