Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1.  
  2. <body>
  3.  
  4. <form method="post" action="pn.php">
  5.  
  6. <p>Email :<input type="text" name="nama"></p>
  7.  
  8. <p>Pesan :<input type="text" name="pesan"></p>
  9.  
  10. <input type="submit" name=โ€submit" value="post">
  11.  
  12. </form>
  13.  
  14. <?php
  15.  
  16. $email = $_POST['nama'];
  17.  
  18. $pesan = $_POST['pesan'];
  19.  
  20. $myFile = 'data.txt';
  21.  
  22. $fh = fopen($myFile, 'a') or die("cant open file");
  23.  
  24. $stringData = "".$nama." ".$pesan."\n";
  25.  
  26. fwrite($fh, $stringData);
  27.  
  28. fclose($fh);
  29.  
  30. echo "sukses";
  31.  
  32.  
  33.  
  34. ?>
  35. </body>
  36.  
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement