In this repo i store all my websites, each in a different branch
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
889 B

  1. <?php
  2. $EmailTo = "marcel@haazen.xyz";
  3. $Name = Trim(stripslashes($_POST['Name']));
  4. $Subject = Trim(stripslashes($_POST['Subject']));
  5. $Email = Trim(stripslashes($_POST['Email']));
  6. $Message = Trim(stripslashes($_POST['Message']));
  7. // validation
  8. if (empty($_POST['Email']) || empty($_POST['Subject']) || empty($_POST['Message']) || empty($_POST['Name'])) {
  9. print "<meta http-equiv=\"refresh\" content=\"0;URL=contact\">";
  10. exit;
  11. }
  12. // prepare email body text
  13. $Body = "";
  14. $Body .= "Name: ";
  15. $Body .= $Name;
  16. $Body .= "\n";
  17. $Body .= "Email: ";
  18. $Body .= $Email;
  19. $Body .= "\n";
  20. $Body .= "Message: ";
  21. $Body .= $Message;
  22. $Body .= "\n";
  23. // send email
  24. $success = mail($EmailTo, $Subject, $Body, "From: <$Email>");
  25. // redirect to success page
  26. if ($success){
  27. print "<meta http-equiv=\"refresh\" content=\"0;URL=contact\">";
  28. }
  29. else{
  30. print "error";
  31. }
  32. ?>