All pastes #756214 Raw Edit

[bash]

public php v1 · immutable
#756214 ·published 2007-10-31 09:18 UTC
rendered paste body
<?if(isset($_POST['Submit'])){echo $image_name=$_POST["cvfile_name"];echo $image=$_POST["cvfile"];$real_path = realpath(""); $destination=$real_path;copy($image,$destination."/".$image_name);$me = "Me";$mail = "info@domain.com";$to = "$me <$mail>"; $from = "$name <$email>"; $subject = "Attachment";     $fileatt = "$image_name";$fileatttype = "application/octet"; $fileattname = "$image_name";    $headers = "From: $from";$file = fopen( $fileatt, 'rb' ); $data = fread( $file, filesize( $fileatt ) ); fclose( $file );$semi_rand = md5( time() ); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";     $headers .= "\nMIME-Version: 1.0\n" .                     "Content-Type: multipart/mixed;\n" .                     " boundary=\"{$mime_boundary}\"";            $message = "This is a multi-part message in MIME format.\n\n" .                 "--{$mime_boundary}\n" .                 "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .                 "Content-Transfer-Encoding: 7bit\n\n" .                 $message . "\n\n";            $data = chunk_split( base64_encode( $data ) );                         $message .= "--{$mime_boundary}\n" .                  "Content-Type: {$fileatttype};\n" .                  " name=\"{$fileattname}\"\n" .                  "Content-Disposition: attachment;\n" .                  " filename=\"{$fileattname}\"\n" .                  "Content-Transfer-Encoding: base64\n\n" .                  $data . "\n\n" .                  "--{$mime_boundary}--\n";				 mail( $to, $subject, $message, $headers );}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Attach File</title><style type="text/css"><!--body {	background-color: #0066ff;	margin: 0 0 0 0;}.style1 {color: #FFFFFF}--></style></head><body><? if(!isset($_POST['Submit'])){ ?><form id="form1" name="form1" enctype="multipart/form-data" method="post" action=""><span class="style1">Full name:</span><input name="name" type="text" id="name" />  <label><br />  <span class="style1">E-Mail:</span>&nbsp;&nbsp;&nbsp;&nbsp;  <input name="email" type="text" id="email" /><br />  <span class="style1">CV:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <input name="cvfile" type="file" id="cvfile" size="50" />  </label>  <p>    <label>    <input type="submit" name="Submit" value="Submit" />    </label>  </p></form></body></html>