This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
107 lines (103 loc) · 3.72 KB
/
mail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
require_once("config.php");
$id = stripslashes($_COOKIE["id"]);
$name = stripslashes($_POST["name"]);
$mail = stripslashes($_POST["mail"]);
$skype = stripslashes($_POST["skype"]);
$post = stripslashes($_POST["post"]);
$exp = stripslashes($_POST["exp"]);
$test = stripslashes($_POST["test"]);
$text = stripslashes($_POST["text"]);
function get_client_ip() {
$ipaddress = '';
if (getenv('HTTP_CLIENT_IP'))
$ipaddress = getenv('HTTP_CLIENT_IP');
else if(getenv('HTTP_X_FORWARDED_FOR'))
$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
else if(getenv('HTTP_X_FORWARDED'))
$ipaddress = getenv('HTTP_X_FORWARDED');
else if(getenv('HTTP_FORWARDED_FOR'))
$ipaddress = getenv('HTTP_FORWARDED_FOR');
else if(getenv('HTTP_FORWARDED'))
$ipaddress = getenv('HTTP_FORWARDED');
else if(getenv('REMOTE_ADDR'))
$ipaddress = getenv('REMOTE_ADDR');
else
$ipaddress = 'UNKNOWN';
return $ipaddress;
}
$text = strtr($text, [
'Ș' => 'Ș',
'ș' => 'ș',
'Ț' => 'Ț',
'ț' => 'ț',
'Ă' => 'Ă',
'ă' => 'ă',
'Â' => 'Â',
'â' => 'â',
'Î' => 'Î',
'î' => 'î',
]);
if($post == "traducator")
$result = $sql->query("select * from `traducere` where `testid`='$test'");
elseif($post == "verificator")
$result = $sql->query("select * from `verificare` where `testid`='$test'");
else
$result = 0;
if($result->num_rows > 0)
{
$row = $result->fetch_row();
$data = $row["2"];
}
else
{
$data = "null";
}
$to = "naihaz@wien-subs.ro";
$headers = "From: facebook@wien-subs.ro" . "\r\n" .
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'Cc: florinmohican@wien-subs.ro' . "\r\n";
$headers .= 'Bcc: harvujr@gmail.com' . "\r\n";
$subject = "Cerere $name";
$message = "<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>";
$message .= "id: $id <br/>";
$message .= "name: $name <br/>";
$message .= "mail: $mail <br/>";
$message .= "skype: $skype <br/>";
$message .= "postul dorit: $post <br/>";
$message .= "experienta: $exp <br/>";
$message .= "IP-Address: ".get_client_ip()." <br/>";
// general data
if($post == "traducator" || $post == "verificator")
{
$message .= "Testul : $test <br/>";
$message .= "<hr/><hr/>$data<hr/><hr/>";
$message .= "<h1>Testul tradus</h1><hr/>";
$message .= "<pre>$text</pre>";
}
$message .= "<center>====End Of MAIL====</center>";
mail($to, $subject, $message, $headers);
if(isset($mail))
{
$header = "From: recrutare@wien-subs.ro" . "\r\n" .
$header .= 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$subjec = "Cerere $name";
$messag = "<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>";
$messag .= "Poti intra pe https://wien-subs.ro/recrutare/show.php <br/>Pentru a vedea statusul cerereri, trebuie sa folosesti aceasta cheia pentru a te loga <br/><center>$id</center>";
mail($mail, $subjec, $messag, $header);
}
setcookie("already", true, time() + (86400 * 999), "/" );
setcookie("specialkey", $id, time() + (86400 * 999), "/" );
//die("insert into `teste` (`nume`, `mail`, `skype`, `post`, `exp`, `key`, `testid`, `testresult`) values ('$name', '$mail', '$skype', '$post', '$exp', '$id', '$test', \"$text\");");
$sql->query("insert into `teste` (`nume`, `mail`, `skype`, `post`, `exp`, `key`, `testid`, `testresult`) values ('$name', '$mail', '$skype', '$post', '$exp', '$id', '$test', \"$text\");");
addlog("System", "sent mail to $mail", "recrutare");
header("Location: index.php?status=complet");
?>