plotagem.php
<!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>KADNEWS | Projetando a Evolução | Fale Conosco</title> <link href="borda.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- @import url("texto.css"); @import url("mini.css"); --> </style> </head> <body bgcolor="#e4e4e4" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" height="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <th align="center" valign="top" nowrap="nowrap" background="kadtop2.jpg" scope="col"><table width="760" height="200" border="0" cellpadding="0" cellspacing="0"> <tr> <th scope="col"><img src="kadtop3.jpg" width="760" height="200" border="0" usemap="#Map" /></th> </tr> </table></th> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <th scope="col"><table width="750" height="100%" border="0" align="center" cellpadding="0" cellspacing="5" class="borda"> <tr> <th scope="col"><form action="envia2.php" method="post" enctype="multipart/form-data" name="form2" id="form2"> <table width="730" border="0" cellspacing="0" cellpadding="0"> <tr> <th colspan="4" scope="col"> </th> </tr> <tr> <td colspan="2" class="subtit">Fale Conosco Plotagem: </td> <td width="274" colspan="2" rowspan="11" align="right"><img src="contato.jpg" width="274" height="283" /></td> </tr> <tr> <td width="134"> </td> <td> </td> </tr> <tr> <td class="texto"><div align="right">Nome:</div></td> <td width="322" align="left"><label> <input name="nome" type="text" class="texto" id="nome" size="60" /> </label></td> </tr> <tr> <td class="texto"><div align="right"></div></td> <td class="texto"> </td> </tr> <tr> <td class="texto"><div align="right">E-mail:</div></td> <td align="left"><label> <input name="email" type="text" class="texto" id="email" size="60" /> </label></td> </tr> <tr> <td class="texto"><div align="right"></div></td> <td class="texto"> </td> </tr> <tr> <td valign="top" class="texto"><div align="right">Comentário:</div></td> <td align="left"><label> <input name="plot" type="file" class="texto" id="plot" size="48" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="left"><label> <input name="enviar" type="submit" class="fundo" id="enviar" value="Enviar" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td valign="bottom"><div align="left"><a href="index.html" class="mini">· voltar ·</a></div></td> <td> </td> </tr> <tr> <td colspan="4"> </td> </tr> </table> </form> </th> </tr> </table></th> </tr> </table> <table width="100%" height="92" border="0" cellpadding="0" cellspacing="0" background="kadtop4.jpg"> <tr> <th valign="bottom" scope="col"><table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="kadtop5.jpg" width="760" height="92" border="0" usemap="#Map2" /></td> </tr> </table></th> </tr> </table> <map name="Map" id="Map"> <area shape="rect" coords="111,27,352,155" href="index.html" /> <area shape="rect" coords="371,162,418,186" href="index.html" /> <area shape="rect" coords="424,163,491,186" href="#" /> <area shape="rect" coords="498,162,563,189" href="kadcli.html" /> <area shape="rect" coords="676,161,740,190" href="kadfale.html" /> <area shape="rect" coords="577,162,663,187" href="kadonde.html" /> </map> <map name="Map2" id="Map2"><area shape="rect" coords="717,22,739,45" href="http://thiagoacioli.blogspot.com" target="_blank" /> </map></body> </html>
Envia2.php:
<? $mail = $_POST["email"]; $message = "Nome :".$_POST["nome"]."<br>"; $message .= "E_mail :".$mail."<br>"; $message .= "Comentário :".$_POST["texto"]."<br>"; $subject = "Formulário recebido"; $anexo = $_POST["plot"]; if ($action != "upload"){ $mime_list = array("html"=>"text/html","htm"=>"text/html", "txt"=>"text/plain", "rtf"=>"text/enriched","csv"=>"text/tab-separated-values","css"=>"text/css","gif"=>"image/gif"); $ABORT = FALSE;$boundary = "XYZ-" . date(dmyhms) . "-ZYX"; $message = "--$boundary\n"; $message .= "Content-Transfer-Encoding: 8bits\n"; $message .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\n\n"; $message .= $body;$message .= "\n";$attachments[1] = $anexo; foreach ($attachments as $key => $full_path) { if ($full_path !='') { if (file_exists($full_path)){ if ($fp = fopen($full_path,"rb")) { $filename = array_pop(explode(chr(92),$full_path)); $contents = fread($fp,filesize($full_path)); $encoded = base64_encode($contents); $encoded_split = chunk_split($encoded); fclose($fp); $message .= "--$boundary\n"; $message .= "Content-Type: $anexo_type\n"; $message .= "Content-Disposition: attachment; filename=\"$anexo_name\" \n"; $message .= "Content-Transfer-Encoding: base64\n\n"; $message .= "$encoded_split\n"; } else { echo "Impossível abrir o arquivo$key: $filename"; $ABORT = TRUE; } } else { echo "O arquivo$key não existe: $filename"; $ABORT = TRUE; }}} $message .= "--$boundary--\r\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "From: <$from>\r\n"; $headers .= "Content-type: multipart/mixed; boundary=\"$boundary\"\r\n"; $mensagem=mail("mzaidan@gmail.com", $subject, $message, $headers); if ($mensagem) { print "Mensagem enviada!";} else { print "O envio da mensagem falhou!";}} ?>