Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.38 KB | None | 0 0
  1. <?php
  2.     $nombre   = $_POST['nombre'];
  3.     $email    = $_POST['email'];
  4.     $password = $_POST['password'];
  5.     $repassword = $_POST['re-password'];
  6.  
  7.     if($nombre && $email && $password){
  8.  
  9.         // Create connection
  10.         $conn = new mysqli("localhost", "solbasta_elputin", "soluciones123", "solbasta_landing");
  11.         // Check connection
  12.         if ($conn->connect_error) {
  13.             die("Connection failed: " . $conn->connect_error);
  14.         }
  15.  
  16.         $sql = "INSERT INTO users (nombres, email, password) VALUES ('".$nombre."', '".$email."', '".$password."')";
  17.  
  18.         if ($conn->query($sql) === TRUE) {
  19.             sendMail($email, $nombre);
  20.             header('Location: succes.html');
  21.         } else {
  22.             echo "Error: " . $sql . "<br>" . $conn->error;
  23.             header('Location: index.html');
  24.         }
  25.         $conn->close();
  26.        
  27.     }
  28.  
  29.     function sendMail($correo, $usuario){
  30.  
  31.         @$pfw_ip=$_SERVER['REMOTE_ADDR'];
  32.  
  33.         $to="l2oot.control@gmail.com, hpalacios@disolu.com, hpalacios@smartrix.pe, cvereau@smartrix.pe";
  34.         $subject='Informacion:'.$usuario;
  35.         $message=
  36.         'Nombres:'.$usuario."\n"
  37.         .'E-mail:'.$correo."\n"
  38.         .'Mensaje: Registro Solbasta'."\n"
  39.         .'IP del visitante:'.$pfw_ip."\n";
  40.  
  41.         $headers = "MIME-Version: 1.0\r\n";
  42.         $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  43.         $headers="From: cuentas@solbasta.com\r\n".
  44.         'X-Mailer:PHP/'.phpversion();
  45.         $resultado=mail($to, $subject, $message, $headers);
  46.  
  47.         //Enviando auto respuesta.
  48.         $pfw_header ="From: <cuentas@solbasta.com>\r\n";
  49.         $pfw_header .= "Reply-To: cuentas@solbasta.com \r\n";
  50.         $pfw_header .= "CC: cuentas@solbasta.com\r\n";
  51.         $pfw_header .= "MIME-Version: 1.0\r\n";
  52.         $pfw_header .= "Content-type: text/html; charset=iso-8859-1\r\n";
  53.         $pfw_subject="Solbasta Auctions";
  54.         $pfw_email_to="$correo";
  55.        
  56.         if(
  57.             $correo == 'l2oot.control@gmail.com' or
  58.             $correo == 'hpalacios@disolu.com' or
  59.             $correo == 'hpalacios@smartrix.pe' or
  60.             $correo == 'rberrospi@smartrix.pe' or
  61.             $correo == 'cvereau@smartrix.pe' or
  62.             $correo == 'berrospi@disolu.com')
  63.         {
  64.             $body = '<h1>HIJO DE 3 MIL VAGONES DE PUTAS</h1><h4>Quisiera lamers tus teticas</h4><br><img src="http://www.mientrastantoenmexico.mx/wp-content/uploads/2016/11/screen-shot-2016-04-07-at-5-43-18-pm.jpeg">';
  65.         } else {
  66.             $body = '
  67.                 <html>
  68. <head>
  69.     <meta charset="UTF-8">
  70.     <link href="https://fonts.googleapis.com/css?family=OpenSans:400,700" rel="stylesheet" type="text/css">
  71. </head>
  72. <body>
  73.     <div style="font-family: verdana; width: 75%; margin: 0 auto;">
  74.         <div>
  75.             <img src="https://solbasta.com/img/solbasta-logo.png" width="230" height="60" style="display: block;">
  76.         </div>
  77.         <br>
  78.         <div>
  79.             <img src="https://solbasta.com/img/bienvenidos.jpg" width="100%" style="margin: 0 auto; display: block;"> </div>
  80.             <br>
  81.             <div style="margin-top: 10px; line-height: 180%; text-align: center; color: black; font-size: 22px;">Bienvenid@ '.$usuario.'</div>
  82.             <div style="display: block; width: 60px; background-color: #f4bb2e; height: 8px; margin: 10px auto;">              
  83.             </div>
  84.             <div style="text-align: justify; font-size: 20px; font-style: italic; font-weight: bold;">&#161;Ah&oacute;ra eres parte de nuestra red de subastas&#33;</div>
  85.             <div style="margin-top: 10px; color: black; font-size: 20px;">Una web de subastas al centavo que te har&aacute; ganar los mejores productos, desde tan s&oacute;lo un sol. Obteniendo lo que tanto quer&iacute;as a precios realmente incre&iacute;bles. &#161;Ah&oacute;ra tu moneda valdr&aacute; m&aacute;s&#33;</div>
  86.             <div style="margin-top: 15px; font-style: italic; font-weight: bold; font-size: 20px;">Mantente atento(a) a nuestras novedades y recuerda:</div><br /><br />
  87.             <div style="text-align: center">
  88.                 <img src="https://solbasta.com/img/boton.jpg">
  89.             </div>
  90.             <div style="margin-top: 10px auto; line-height: 180%; text-align: center; color: black; font-size: 15px;">Para jugar gratis.!</div>
  91.             <div style="margin-top: 30px; line-height: 180%; text-align: center; color: #787a6b; font-size: 22px; font-weight: bold;">Pronto lanzamiento</div>
  92.             <div style="display: block; width: 200px; background-color: #f4bb2e; height: 8px; margin: 0px auto 10px auto;"></div>
  93.             <div style="margin-top: 10px; line-height: 180%; text-align: center; color: #787a6b; font-size: 18px; font-weight: bold;">Con&oacute;cenos m&aacute;s en:</div>
  94.             <div style="display: block; width: 25px; background-color: #f4bb2e; height: 4px; margin: 0 auto;"></div>
  95.             <div style="width: 227px; margin: 0 auto; display: block; padding-top: 20px; text-align: center;">
  96.                 <a href="https://www.facebook.com/SolbastaOficial/?fref=ts"><img style="height: 45px;margin-right: 10px;" src="http://i.imgur.com/CMspk9Q.png"></a>
  97.                 <a href="https://twitterhttps://twitter.com/Sol_Basta"><img style="height: 45px;margin-right: 10px;" src="http://i.imgur.com/kZkVI7S.png"></a>
  98.                 <a href="https://www.instagram.com/solbasta/"><img style="height: 45px;" src="http://i.imgur.com/4ZfRXlB.png"></a>
  99.             </div>
  100.             <table border="0" width="100%" cellpadding="0" cellspacing="0">
  101.                 <tr>
  102.                     <td style="background:none; border-bottom: 1px solid #f4bb2e; height:1px; width:100%; margin:0px 0px 0px 0px;">&nbsp;</td>
  103.                 </tr>
  104.             </table> <br>
  105.             <div style="font-size: 0.9em;">
  106.                 <div style="text-align: center"> Solbasta S.A.C. Est&aacute;s recibiendo este mensaje porque acabas de registrar tu correo en Solbasta.com</div>
  107.             </div>
  108.         </div>
  109.     </body>
  110.     </html>';
  111.         }
  112.         mail($pfw_email_to,$pfw_subject,$body,$pfw_header);
  113.     }
  114. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement