Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include 'conexion.php';
- if(isset($_POST) && !empty($_POST)){
- if(!empty($_FILES['archivo']['name'])){
- $names = $_SESSION['usuario']['nombres'];
- $ape = $_SESSION['usuario']['apellidos'];
- $dni = $_SESSION['usuario']['dni'];
- $tlf1 = $_SESSION['usuario']['fijo'];
- $tlf2 = $_SESSION['usuario']['mov'];
- $email = $_SESSION['usuario']['email'];
- $d_entrega = $_SESSION['usuario']['direccion_entrega'];
- $d_facturacion = $_SESSION['usuario']['direccion_facturacion'];
- $cod = $_POST['cod'];
- $file_name = $_FILES['archivo']['name'];
- $temp_name = $_FILES['archivo']['tmp_name'];
- $file_type = $_FILES['archivo']['type'];
- $base = basename($file_name);
- $extension = substr($base, strlen($base)-4, strlen($base));
- $extensiones = array(".doc",".docx",".pdf",".png",".jpg",".jpeg");
- if(in_array($extension,$extensiones)){
- $from = $_POST['email'];
- $to = "hmla9612@gmail.com";
- $asunto = "CONFIRMACIÓN DE PAGO DE PEDIDO";
- $mensaje = '
- <html>
- <body>
- <p><img src="http://mvmultiservicios.es/banners/multi_mv_.jpg" width="669" height="348" /><br />
- <br />
- </p>
- <h2 class="tre2">DATOS DE LA PERSONA QUIEN CONFIRMO SU DEPOSITO O TRANSFERENCIA<br />
- </h2>
- <h4>Nombres: '.$names.' '.$ape.'</h4>
- <h4>DNI: '.$dni.'</h4> <br />
- <h4>Telefono Fijo: '.$tlf1.'</h4>
- <h4>Telefono Movil: '.$tlf2.'</h4>
- <h4>Email: '.$email.'</h4>
- <h4>Dirección de entrega: '.$d_entrega.'</h4>
- <h4>Dirección de Facturación: '.$d_facturacion.'</h4>
- <br><br>
- <h4>'.$cod.'</h4>
- <img src="http://mvmultiservicios.es/images/abajoemail.jpg" width="669" border="0" usemap="#Map" />
- <map name="Map" id="Map">
- <area shape="rect" coords="37,227,113,250" href="http://mvmultiservicios.es/contacto.php" target="_blank" />
- <area shape="rect" coords="12,5,656,40" href="http://mvmultiservicios.es/reporte.php" target="_blank" />
- </map>
- <br />
- <span class="trebww"> Multiservicios Melga-Villafuerte SL.<br />
- Dirección: C/Padilla 334-336, Local 1, C.P. 08025 Barcelona<br />
- +34931 75 69 73 +34 601 020 475<br />
- info@mvmultiservicios.es | comercial@mvmultiservicios.es</span></h3>
- <h2 class="tre2"> </h2>
- <h2 class="treb"> </h2>
- <p> <br />
- <br />
- </p>
- </body>
- </html>
- ';
- $file = $temp_name;
- $content = chunk_split(base64_encode(file_get_contents($file)));
- $uid = md5(uniqid(time()));
- $header = "From: ".$from."rn";
- $header .= 'MIME-Version: 1.0' . "rn";
- $header .= "Content-Type: multipart/mixed; boundary="".$uid.""rnrn";
- $header .= "--" .$uid. "rn";
- $header .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
- $header .= "Content-Transfer-Encoding: 7bitrnrn";
- $header .= "--".$ui."rn";
- $header .= "Content-Type: ".$file_type."; name="".$file_name.""rn";
- $header .= "Content-Transfer-Encoding: base64rn";
- $header .= "Content-Disposition: attachment; filename="".$file_name.""rnrn";
- $header .= $content."rnrn";
- if(mail($to, $asunto, $mensaje, $header)){
- echo "success";
- }else{
- echo "fallo el envio";
- }
- }else{
- echo "El formato del archivo no es admitido";
- }
- }else{
- echo "No hay archivo adjuntado";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment