Bringing up PHP GD problem again, help please
Posted: Thu May 31, 2007 1:38 am
I'm (still) trying to send a PHP GD image as a form-to-mail attachment. I have this:
in my sendmail.php.
I'm using file_get_contents() but I think the parameters in the parentheses shouldn't be:
because that way I literally get the contents of $im:
Thing is, how do I call/get the processed contents of $im in my sendmail.php?
Help please...
P.S.
This is part of my sendmail.php.. Please correct all that looks wrong:
Code: Select all
$im = image.php
I'm using file_get_contents() but I think the parameters in the parentheses shouldn't be:
Code: Select all
$file = file_get_contents($im, 'rb');
Code: Select all
<?php header("Content-type:image/gif");
$image = imagecreatetruecolor(231,200) or die ("Cannot create image");
$black = imagecolorallocate($image,0,0,0);
$white = imagecolorallocate($image,255,255,255);
etcetera
Help please...
P.S.
This is part of my sendmail.php.. Please correct all that looks wrong:
Code: Select all
$file = file_get_contents($im, 'rb');
ob_start();
imagegif($im, '', 70);
$file = ob_get_clean();
$message .= "Content-Type: image/gif; name=\"image.gif\"\r\n"
."Content-Transfer-Encoding: base64\r\n"
."Content-disposition: attachment; file=\$im\r\n"
."\r\n"
.chunk_split(base64_encode($file))
.$bound_last;