Bijgaand onderstaande code.
<?php
// Create the image
$im = imagecreatetruecolor(200, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 199, 29, $white);
$text = '*'.$_GET['id'].'*';
$font = 'fonts/Code-39-25.ttf';
// Add the text
imagettftext($im, 26, 0, 10, 30, $black, $font, $text);
$id = $_GET['id'];
$filename = 'barcode';
$extentie = '.png';
$FileResult = $filename . $id . $extentie;
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im, $FileResult);
imagedestroy($im);
$to = '[email protected]';
$subject = 'barcode test';
$message = '
<hmtl>
<head>
<title></title>
</head>
<body>
Dit is een test met een barcode als plaatje.<br /><br />
<img src="http://www.testing.nl/'.$FileResult.'">
</body>
</head>
';
$headers = "From: testing <[email protected]> \r\nContent-Type: text/html; charset=uft-8\r\nMIME-Version: 1.0";
mail($to,$subject,$message,$headers);
?>
Code zelf werkt perfect, maar zit toch met 1 klein probleem. Wanneer ik dit run genereert hij ook wel een plaatje, en stuurt een e-mail, maar het plaatje komt gelijk op mijn c-schijf te staan. Ik moet hem dus daarna handmatig uploaden naar de server. Schiet uiteraard niet op. Iemand een idee om dit op te lossen?