Browse Source

Fix .js and .php for sending mail.

master
Admin pard0x 1 year ago
parent
commit
068f874de3
2 changed files with 6 additions and 6 deletions
  1. 2
    2
      js/contact_me.js
  2. 4
    4
      mail/contact_me.php

+ 2
- 2
js/contact_me.js View File

@@ -14,7 +14,7 @@ $(function() {
14 14
             event.preventDefault(); // prevent default submit behaviour
15 15
             // get values from FORM
16 16
             var name = $("input#name").val();
17
-            var phone = $("input#phone").val();
17
+            var subject = $("input#subject").val();
18 18
             var email = $("input#email").val();
19 19
             var message = $("textarea#message").val();
20 20
             var firstName = name; // For Success/Failure Message
@@ -27,7 +27,7 @@ $(function() {
27 27
                 type: "POST",
28 28
                 data: {
29 29
                     name: name,
30
-                    phone: phone,
30
+                    subject: subject,
31 31
                     email: email,
32 32
                     message: message
33 33
                 },

+ 4
- 4
mail/contact_me.php View File

@@ -2,7 +2,7 @@
2 2
 // Check for empty fields
3 3
 if(empty($_POST['name'])      ||
4 4
    empty($_POST['email'])     ||
5
-   empty($_POST['phone'])     ||
5
+   empty($_POST['subject'])     ||
6 6
    empty($_POST['message'])   ||
7 7
    !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
8 8
    {
@@ -12,13 +12,13 @@ if(empty($_POST['name'])      ||
12 12
    
13 13
 $name = strip_tags(htmlspecialchars($_POST['name']));
14 14
 $email_address = strip_tags(htmlspecialchars($_POST['email']));
15
-$phone = strip_tags(htmlspecialchars($_POST['phone']));
15
+$subject = strip_tags(htmlspecialchars($_POST['subject']));
16 16
 $message = strip_tags(htmlspecialchars($_POST['message']));
17 17
    
18 18
 // Create the email and send the message
19 19
 $to = 'contact@pard0x.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
20
-$email_subject = "pard0x 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";
20
+$email_subject = "pard0x Contact Form:  $subject ";
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\nMessage:\n$message";
22 22
 $headers = "From: noreply@pard0x.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
23 23
 $headers .= "Reply-To: $email_address";   
24 24
 mail($to,$email_subject,$email_body,$headers);

Loading…
Cancel
Save