Would you please help me to fix the problem of sending two emails instead of just one every time I run the following code using this url:
http://domain.org/image.php?path=dir/file.jpg
<?php
$email="email@domain.org";
$body = "the body";
$subject="the subject";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Image Visit Receipt <rr@mrdv.org>' . "\r\n";
mail($email,$subject,$body,$headers);
if ($HTTP_GET_VARS["path"])
{
$imagepath="/home2/mydomain/public_html/files/images/".$HTTP_GET_VARS["path"];
if (file_exists($imagepath))
{
$image=imagecreatefromjpeg($imagepath);
header('Content-Type: image/jpeg');
imagejpeg($image);
exit;
}
}
?>