fork download
  1. <?php
  2. // Check for empty fields
  3. if(empty($_POST['name']) ||
  4. empty($_POST['email']) ||
  5. empty($_POST['phone']) ||
  6. empty($_POST['message']) ||
  7. !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
  8. {
  9. echo "No arguments Provided!";
  10. return false;
  11. }
  12.  
  13. $name = strip_tags(htmlspecialchars($_POST['name']));
  14. $email_address = strip_tags(htmlspecialchars($_POST['email']));
  15. $phone = strip_tags(htmlspecialchars($_POST['phone']));
  16. $message = strip_tags(htmlspecialchars($_POST['message']));
  17.  
  18. // Create the email and send the message
  19. $to = 'xxkchoxx@gmail.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
  20. $email_subject = "Website Contact Form: $name";
  21. $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
  22. $headers = "From: no-responder@institutodip.com.ar\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
  23. $headers .= "Reply-To: $email_address";
  24. mail($to,$email_subject,$email_body,$headers);
  25. return true;
  26. ?>
  27.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
No arguments Provided!