Advertisement
Guest User

Untitled

a guest
May 24th, 2017
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['submit'])) {
  3.  
  4. define('ROOT', 'http://localhost/septian/tes/untuk_blog/v_email/');
  5. $koneksi=mysql_connect('localhost','root','');
  6. mysql_select_db('untuk_blog',$koneksi);
  7.  
  8. $kode = md5(uniqid(rand()));
  9. $password = md5($_POST['password']);
  10.  
  11. $query = mysql_query("INSERT INTO verifikasi_email (id, username, password, email, aktif, kode) VALUES ('', '$_POST[username]', '$password', '$_POST[email]','T', '$kode' )") or die (mysql_error());
  12.  
  13. $to = $_POST['email'];
  14. $judul = "Aktivasi Akun Anda";
  15. $dari = "From: septian@tian.com \n";
  16. $dari .= "Content-type: text/html \r\n";
  17.  
  18. $pesan = "Klik link berikut untuk mengaktifkan akun: <br />";
  19. $pesan .= "<a href='".ROOT."konfirm.php?email=".$_POST['email']."&kode=$kode&username=".$_POST['username']."'>".ROOT."konfirm.php?email=".$_POST['email']."&kode=$kode</a>";
  20.  
  21. $kirim = mail($to, $judul, $pesan, $dari);
  22.  
  23. if($kirim AND $query)
  24. {
  25. echo "<p class=info>Berhasil Dikirim</p>";
  26. }
  27. else
  28. {
  29. echo "<p class=infoGagal>Gagal Dikirim</p>";
  30. }
  31.  
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement