. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 52.223.31.75 / Your IP : 172.31.32.98 [ Web Server : Apache/2.4.66 () OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux ip-172-31-14-81.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE Domains : 4 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/ripara.co/bat/ |
Upload File : |
<?php
$recipients = "info@ripara.co";
try {
require './phpmailer/PHPMailerAutoload.php';
preg_match_all("/([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)/", $recipients, $addresses, PREG_OFFSET_CAPTURE);
if (!count($addresses[0])) {
die('MF001');
}
if (preg_match('/^(127\.|192\.168\.)/', $_SERVER['REMOTE_ADDR'])) {
die('MF002');
}
$template = file_get_contents('./bat/rd-mailform.tpl');
if (isset($_POST['form-type'])) {
switch ($_POST['form-type']){
case 'comment':
$subject = 'Commento ricevuto su articolo '.$_POST['articolo'];
break;
}
}else{
die('MF004');
}
if (isset($_POST['email'])) {
$template = str_replace(
array("<!-- #{FromState} -->", "<!-- #{FromEmail} -->"),
array("Email:", $_POST['email']),
$template);
}else{
die('MF003');
}
if (isset($_POST['message'])) {
$template = str_replace(
array("<!-- #{MessageState} -->", "<!-- #{MessageDescription} -->"),
array("Message:", $_POST['message']),
$template);
}
preg_match("/(<!-- #{BeginInfo} -->)(.|\n)+(<!-- #{EndInfo} -->)/", $template, $tmp, PREG_OFFSET_CAPTURE);
foreach ($_POST as $key => $value) {
if ($key != "email" && $key != "message" && $key != "form-type" && !empty($value)){
$info = str_replace(
array("<!-- #{BeginInfo} -->", "<!-- #{InfoState} -->", "<!-- #{InfoDescription} -->"),
array("", ucfirst($key) . ':', $value),
$tmp[0][0]);
$template = str_replace("<!-- #{EndInfo} -->", $info, $template);
}
}
$template = str_replace(
array("<!-- #{Subject} -->", "<!-- #{SiteName} -->"),
array($subject, $_SERVER['SERVER_NAME']),
$template);
$template.= "<br> Articolo corrispondente: ". $_POST['articolo'];
$mail = new PHPMailer();
$mail->From = $_POST['email'];
if (isset($_POST['name'])){
$mail->FromName = $_POST['name'];
}else{
$mail->FromName = "Ripara.co";
}
foreach ($addresses[0] as $key => $value) {
$mail->addAddress($value[0]);
}
$mail->CharSet = 'utf-8';
$mail->Subject = $subject;
$mail->MsgHTML($template);
$mail->send();
include "../connessioneDb.php";
$sql = "SELECT * FROM categoria";
$sql = "INSERT INTO commenti_blog (id_blog, nome, email, testo) VALUES ('".intval($_POST['id_blog'])."', '".$_POST['name']."', '".$_POST['email']."', '".$_POST['message']."')";
$date = mysql_query($sql);
echo mysql_error();
die('MF000');
} catch (phpmailerException $e) {
die('MF254');
} catch (Exception $e) {
die('MF255');
}