Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. //w kontakt.html mam to:
  2. <div id="formularz">
  3. <form method="post" action="kontakt.php">
  4. <label>Imię/pseudonim</label>
  5. <input name="name" placeholder="np. Dominik">
  6.  
  7. <label>Email</label>
  8. <input name="email" type="email" placeholder="np. jkowalski@gmail.com">
  9.  
  10. <label>Wiadomość</label>
  11. <textarea name="message" placeholder="Napisz tu wiadomość"></textarea>
  12.  
  13. <input id="submit" name="submit" type="submit" value="Wyślij">
  14. </form>
  15. </div>
  16.  
  17. // a w kontakt.php to:
  18. <?php
  19.  
  20. $name = $_POST['name'];
  21. $email = $_POST['email'];
  22. $message = $_POST['message'];
  23. $odkogo = "poweradi@onet.eu";
  24. $dokogo = "adi_96@onet.eu";
  25. $tytul = "Formularz kontaktowy z Nie daj się nudzie w Szczecinie";
  26.  
  27. $wiadomosc = "";
  28. $wiadomosc .= "Imię/pseudonim: " . $name . "\n";
  29. $wiadomosc .= "Email: " . $email . "\n";
  30. $wiadomosc .= "Wiadomość: " . $message . "\n";
  31.  
  32. $naglowek = "";
  33. $naglowek .= "Od:" . $odkogo . " \n";
  34. $naglowek .= "Content-Type:text/plain;charset=utf-8";
  35.  
  36. $sukces = mail($dokogo, $tytul, $wiadomosc, $naglowek);
  37.  
  38. if ($sukces){
  39. print "<meta http-equiv="\" refresh\""="" content="\" 0;url="potwierdzenie.html\""">";
  40. }
  41.  
  42. else{
  43. print "<meta http-equiv="\" refresh\""="" content="\" 0;url="error.html\""">";
  44. }
  45.  
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement