Advertisement
irfanamir

kirim.php

Nov 12th, 2020
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1.  
  2. <?php
  3. if($_POST['kirim']){
  4.     $admin = 'fyn250976@gmail.com'; //ganti email dg email admin (email penerima pesan)
  5.    
  6.     $nama   = htmlentities($_POST['nama']);
  7.     $namail = htmlentities($_POST['namail']);
  8.     $judul  = htmlentities($_POST['judul']);
  9.     $pesan  = htmlentities($_POST['pesan']);
  10.    
  11.     $pengirim   = 'Dari: '.$nama.' <'.$namail.'>';
  12.    
  13.     if(mail($admin, $judul, $pesan, $pengirim)){
  14.         echo 'SUCCESS: Pesan anda berhasil di kirim. <a href="index.php">Kembali</a>';
  15.     }else{
  16.         echo 'ERROR: Pesan anda gagal di kirim silahkan coba lagi. <a href="index2.php">Kembali</a>';
  17.     }
  18. }else{
  19.     header("Location: index2.php");
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement