diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bfe817 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/* +composer.lock diff --git a/.vscode/ftp-sync.json b/.vscode/ftp-sync.json index 83b7186..ccb9463 100644 --- a/.vscode/ftp-sync.json +++ b/.vscode/ftp-sync.json @@ -1,5 +1,5 @@ { - "remotePath": "./", + "remotePath": "./slavforest.com.ua", "host": "uvh12.mirohost.net", "username": "slavforest", "password": "cAAed7MU", @@ -14,7 +14,8 @@ "ignore": [ "\\.vscode", "\\.git", - "\\.DS_Store" + "\\.DS_Store", + "\\.db" ], "generatedFiles": { "uploadOnSave": false, diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f4fd79e --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "slim/slim": "^3.0", + "mailgun/mailgun-php": "^2.6", + "slim/php-view": "^2.2" + } +} diff --git a/contact.php b/contact.php index 6bd8e55..d61d324 100644 --- a/contact.php +++ b/contact.php @@ -6,7 +6,7 @@ //E-mail address. Enter your email -define("__TO__", "youremail@domain.com"); +define("__TO__", "sha@shadoll.work"); //Success message define('__SUCCESS_MESSAGE__', "Your message has been sent. We will reply soon. Thank you!"); @@ -41,11 +41,11 @@ function send_mail($to,$subject,$message,$headers){ } //Get data form and send mail -if(isset($_POST['name']) and isset($_POST['mail']) and isset($_POST['messageForm'])){ +if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])){ $name = $_POST['name']; - $mail = $_POST['mail']; - $subjectForm = $_POST['subjectForm']; - $messageForm = $_POST['messageForm']; + $mail = $_POST['email']; + $subjectForm = $_POST['subject']; + $messageForm = $_POST['message']; if($name == '') { echo json_encode(array('info' => 'error', 'msg' => "Please enter your name.")); @@ -96,4 +96,3 @@ if(isset($_POST['name']) and isset($_POST['mail']) and isset($_POST['messageForm } else { echo json_encode(array('info' => 'error', 'msg' => __MESSAGE_EMPTY_FIELDS__)); } - ?> \ No newline at end of file diff --git a/contactengine.php b/contactengine.php new file mode 100644 index 0000000..14b63ab --- /dev/null +++ b/contactengine.php @@ -0,0 +1,86 @@ +
"; +$msg .= '
';
+$msg .= "Від кого: ".$username."
\r\n"; +if(!empty($userphone)) + $msg .= "Телефон: ".$userphone."
\r\n"; +if(!empty($usermail)) + $msg .= "Email: ".$usermail."
\r\n"; +$msg .= "Тема:\r\n".$subj."
\r\n"; +if(!empty($order)) + $msg .= "Заказ:\r\n".$order."
\r\n"; +if(!empty($message)) + $msg .= "Повідомлення:\r\n".$message."
\r\n"; +$msg .= "Реферал: ".$referer."
\r\n"; +$msg .= "IP-адреса відправника: ".$ip."
\r\n"; +if($detect){ + $msg .= "Провайдер: ".$provider."
\r\n"; + $msg .= "Країна: ".$country." 
Регіон: ".$region."
\r\n"; + $msg .= "Населений пункт: ".$city."
\r\n"; +} +$msg .= "