HEX
Server: Apache
System: Linux ns308404 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 8.3.31
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/onlinedev.com/httpdocs/php/CPfunctions.inc.php
<?php

include_once("class.Snoopy.inc.php");
include_once("class.phpmailer.php");
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message) {
//	$myname = urlencode( $myname );
//	$myemail = urlencode( $myemail );
//	$contactname = urlencode( $contactname );
//	$contactemail = urlencode( $contactemail );
//	$subject = urlencode( $subject );
//	$message = urlencode( $message );
	/*
	$hash = "qwehkjlhlkjhqwhb5KGJHGHJGf&*hjgsdfytasd";
	$snoopy = new Snoopy;
	//$submit_url = "http://213.11.100.26/mail/paiedlinks_send_mail/send_true_mail.php";
	$submit_url = "http://217.156.79.194/~laur/paiedlinks_send_mail/send_true_mail.php";
	$submit_vars["myname"] = $myname;
	$submit_vars["myemail"] = $myemail;
	$submit_vars["subject"] = $subject;
	$submit_vars["contactname"] = $contactname;
	$submit_vars["contactemail"] = $contactemail;
	$submit_vars["message"] = $message;
	$submit_vars["hash"] = $hash;
	$snoopy->submit($submit_url,$submit_vars);
	return(1);
*/
	$headers = "Content-Type: text/html\r\nFrom: ".$myname."<".$myemail.">";
	@mail($contactemail, $subject, $message, $headers);
	return 1;
}


if ( ($_POST['request_from'] == "remarques.html") || ($_POST['request_from'] == "mon_projet.html") || ($_POST['request_from'] == "remarques_2.html")) {

            //captcha
            if($_POST['request_from'] == "mon_projet.html") {
                session_start();
                if (md5($_POST['norobot']) <> $_SESSION['randomnr2'])	{
        		// here you  place code to be executed if the captcha test fails
			$_SESSION['post'] = $_POST;
                    	header("Location: http://www.onlinedev.com/mon_projet.html?captcha_error=1");
                    	exit;
                }
            }

	$myname = "admin";
	$myemail = "admin@onlinedev.ro";
	$contactname1 = "contact@onlinedev.com";
	$contactemail1 = "contact@onlinedev.com";
	$contactemail3 = "matei.stefanescu@onlinedev.ro";
	$contactemail4 = 'sarnulf@gmail.com';
//	$contactemail5 = 'laura.i.constantinescu@gmail.com';

	//$subject = "Mail from onlinedev.com using :" . $_POST['request_from'];
	$subject = $_REQUEST['mail_subject_8'];

	$message = $_REQUEST['mail_subject_8'].": <br />\n";

	$message .= "Nom: " . $_POST['mail_subject_2'] . "<br />";
	$message .= "Pr&eacute;nom: " . $_POST['mail_subject_1'] . "<br />";
	$message .= "Soci&eacute;t&eacute;: " . $_POST['mail_subject_3'] . "<br />";
	$message .= "Adresse: " . $_POST['mail_subject_4'] . "<br />";
	$message .= "Code postal: " . $_POST['mail_subject_7'] . "<br />";
	$message .= "Ville: " . $_POST['mail_subject_9'] . "<br />";
	$message .= "Email: " . $_POST['mail_subject_5'] . "<br />";
	$message .= "Tel: " . $_POST['mail_subject_6'] . "<br />";
	$message .= addslashes($_POST['mail_body']);
	if (false)//old way of sending mail
	{
		send_mail($myname, $myemail, $contactname1, $contactemail1, $subject, $message);
	//	send_mail($myname, $myemail, $contactname2, $contactemail2, $subject, $message);
		send_mail($myname, $myemail, $contactname3, $contactemail3, $subject, $message);
		send_mail($myname, $myemail, $contactname4, $contactemail4, $subject, $message);
	}
	foreach(array($contactemail1, $contactemail3, $contactemail4) as $email)
	{
		$mailer = new PHPMailer();
		$mailer->AddAddress($email);
		//$mailer->From = $_REQUEST['mail_subject_5'];
		$mailer->From = 'noreply@onlinedev.com';//$_REQUEST['mail_subject_5'];
		$mailer->FromName = 'Onlinedev.com ('.$_POST['request_from'].')';
		$mailer->AddReplyTo('noreply@onlinedev.com', 'Onlinedev.com');
		//$mailer->FromName = $_REQUEST['post_subject_2'];
		//$mailer->AddReplyTo($mailer->From, $mailer->FromName);
		$mailer->Subject = $subject;
		$mailer->Body = $message;
		$mailer->IsHTML(true);
		if (is_file($_FILES['file']['tmp_name']))
		{
			$mailer->AddAttachment($_FILES['file']['tmp_name'], $_FILES['file']['name']);
		}
		$mailer->Send();
	}

	header("Location: http://www.onlinedev.com/status.html");
	exit;
}

header("Location: http://www.onlinedev.com/index.html");
exit;

?>