<?php
include("header.html");
@$comment = addcslashes($_POST['Name']);
@$Name = addslashes($_POST['Name']);
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload_Mime_Type = $_FILES['upload']['type'];
@$Date = addslashes($_POST['Date']);
@$Description = addslashes($_POST['Description']);
@$People = addslashes($_POST['People']);
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
echo("<div style='position: absolute; top: 200px; left: 125px; z-index: 500;'><p align='center'><b>Please enter a valid email<br /><br /><a href='popup.html'>Go Back</a></p></div>");
include("footer.html");
die();
}
if( $upload_Size == 0)
{
echo("<div style='position: absolute; top: 200px; left: 50px; z-index: 500;'><p align='center'><b>ERROR</b><br />YOUR FILE WAS NOT UPLOADED<br />PLEASE CHECK THE FILE SIZE AND FORMAT<br /><br /><a href='popup.html'>Go Back</a></p></div>");
include("footer.html");
die();
}
// CHANGE THIS TO A HIGHER OR LOWER VALUE - REMEMBER HOSTING LIMITS
if( $upload_Size >2000000)
//--------
{
unlink($upload_Temp);
echo("<div style='position: absolute; top: 200px; left: 50px; z-index: 500;'><p align='center'><b>ERROR</b><br>YOUR FILE WAS NOT UPLOADED<br>PLEASE CHECK THE FILE SIZE AND FORMAT<br /><br /><a href='popup.html'>Go Back</a></p></div>");
include("footer.html");
die();
}
if( $upload_Mime_Type != "image/cgm" AND $upload_Mime_Type != "image/g3fax" AND $upload_Mime_Type != "image/gif" AND $upload_Mime_Type != "image/ief" AND $upload_Mime_Type != "image/pjpeg" AND $upload_Mime_Type != "image/jpeg" AND $upload_Mime_Type != "image/naplps" AND $upload_Mime_Type != "image/png" AND $upload_Mime_Type != "image/prs.btif" AND $upload_Mime_Type != "image/prs.pti" AND $upload_Mime_Type != "image/tiff" AND $upload_Mime_Type != "image/vnd.cns.inf2" AND $upload_Mime_Type != "image/vnd.dwg" AND $upload_Mime_Type != "image/vnd.dxf" AND $upload_Mime_Type != "image/vnd.fastbidsheet" AND $upload_Mime_Type != "image/vnd.fpx" AND $upload_Mime_Type != "image/vnd.fst" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-mmr" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-rlc" AND $upload_Mime_Type != "image/vnd.mix" AND $upload_Mime_Type != "image/vnd.net-fpx" AND $upload_Mime_Type != "image/vnd.svf" AND $upload_Mime_Type != "image/vnd.wap.wbmp" AND $upload_Mime_Type != "image/vnd.xiff" )
{
unlink($upload_Temp);
echo("<div style='position: absolute; top: 200px; left: 50px; z-index: 500;'><p align='center'><b>ERROR</b><br>YOUR FILE WAS NOT UPLOADED<br>PLEASE CHECK THE FILE SIZE AND FORMAT<br /><br /><a href='popup.html'>Go Back</a></p></div>");
include("footer.html");
die();
}
$uploadFile = "uploads/".$upload_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
//CHANGE THIS TO THE YOUR DOMAIN
$upload_URL = "http://upload.**********.org/".$upload_Name ;
//------------
$pfw_header = "From: $email";
$pfw_subject = "AN IMAGE HAS BEEN UPLOADED";
$pfw_random_hash = md5(date('r', time()));
// CHANGE THIS TO YOUR EMAIL ADDRESS
$pfw_email_to = "John********@*****.com";
$pfw_header .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
//read the atachment file contents into a string,
//encode it with MIME base64,
//and split it into smaller chunks
$attachment = chunk_split(base64_encode(file_get_contents("$uploadFile")));
//define the body of the message.
ob_start(); //Turn on output buffering
?>
--PHP-mixed-<?php echo $random_hash; ?>
Content-Type: multipart/alternative; boundary="PHP-alt-<?php echo $random_hash; ?>"
--PHP-alt-<?php echo $random_hash; ?>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<?php echo $Name; ?> from <?php echo $email; ?><br />
Sent you an image which was taken <?php echo $Date; ?>
<br /><br />
<i>"<?php echo $Description; ?>"</i>
<br /><br />
The people in this photo are;<br />
<?php echo $People; ?>
/* The attached comment is <?php $comment; ?> */
--PHP-alt-<?php echo $random_hash; ?>
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<b><?php echo $Name; ?></b> from <a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a><br />
Sent you an image which was taken <?php echo $Date; ?>
<br /><br />
<i>"<?php echo $Description; ?>"</i>
<br /><br />
The people in this photo are;<br />
<?php echo $People; ?>
<!-- The attached comment is: <?php $comment; ?> -->
--PHP-alt-<?php echo $random_hash; ?>--
--PHP-mixed-<?php echo $random_hash; ?>
Content-Type: image/png; name="<?php echo $upload_Name;?>"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
<?php echo $attachment; ?>
--PHP-mixed-<?php echo $random_hash; ?>--
<?php
//copy current buffer contents into $message variable and delete current output buffer
$pfw_message = ob_get_clean();
//send the email
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
echo("<div style='position: absolute; top: 200px; left: 125px; z-index: 500;'><p align='center'><b>THANK YOU!<br>YOUR IMAGE HAS BEEN UPLOADED</div></b></p>");
include("footer.html");
?>
<?php unlink($uploadFile); ?>
|