Untitled

By Flying Macaque, 2 Days ago, written in php.
  1. <?php
  2. include("lib/phpmailer/class.phpmailer.php");
  3.  
  4. include("config/config.smtp.php");
  5. /*
  6. if($_POST['goo']) {
  7.        
  8.         $sql = "Select * From users Where login='".$_POST['login']."'";
  9.                
  10.         $rs = $bd->Execute( $sql );
  11.        
  12.         if($rs->RecordCount() >= 1){
  13.                
  14. $error = '<font color="red"><strong>Error:</strong> Login existente!!</font>';
  15.                
  16.         }else{
  17.         $sql = "INSERT INTO USERS (login,nome,senha,email,periodo) VALUES
  18.                                         ('".$_POST['login']."','".$_POST['nome']."','".$_POST['senha']."',
  19.                                          '".$_POST['email']."','".$_POST['periodo']."')";
  20.  
  21.         $rs = $bd->Execute($sql);
  22.         */
  23.        
  24.         $mail = new PHPMailer();
  25.  
  26.         $mail->AddAddress("[email protected]","".$_POST['nome']."");
  27.  
  28.         $mail->Subject = "Cadastro em ".$_SERVER['HTTP_HOST'];
  29.  
  30.         $mail->Body ='<a href="http://'.HOST."/ativar.php?cod=".md5($_POST['email'])."&uid=".$_POST['login'].'/" target="_blank"> Testeee</a>';
  31.  
  32. $mail->Send();
  33.  
  34. /*if(!$mail->Send())
  35. {
  36. echo "Email não enviado <p>";
  37. echo "Mailer Error: " . $mail->ErrorInfo;
  38. exit;
  39. }*/
  40.  
  41.         if($bd->ErrorMsg()) {
  42.        
  43.         $error = $bd->ErrorMsg();
  44.  
  45.         } else {
  46.        
  47.         $error = '<font color="green"><strong>Parab&eacute;ns! </strong>Registro inclu&iacute;do!!</font>';
  48.  
  49. }
  50.  
  51. //      }}
  52. ?>