wp/wp-content/themes/IN-MOTION-package-u1/in-motion/functions/contactNeRabimG.php
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 0 d970ebf37754
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
//If the form is submitted
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
if(isset($_POST['submit'])) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
	//Check to make sure that the name field is not empty
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
	if(trim($_POST['contactname']) == '') {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
		$hasError = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
	} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
		$name = trim($_POST['contactname']);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
	//Check to make sure that the subject field is not empty
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
	if(trim($_POST['subject']) == '') {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
		$hasError = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
	} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
		$subject = trim($_POST['subject']);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
	//Check to make sure sure that a valid email address is submitted
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
	if(trim($_POST['email']) == '')  {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
		$hasError = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
		$hasError = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		$email = trim($_POST['email']);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
	//Check to make sure comments were entered
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
	if(trim($_POST['message']) == '') {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		$hasError = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
		if(function_exists('stripslashes')) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
			$comments = stripslashes(trim($_POST['message']));
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
		} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
			$comments = trim($_POST['message']);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
	//If there is no error, send the email
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
	if(!isset($hasError)) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
		$emailTo = get_option_tree( 'contact_page_email' );  /*Put your own email address here*/ 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
		$body = "Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
		$headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
		mail($emailTo, $subject, $body, $headers);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
		$emailSent = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
?>