-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfeedback.php
114 lines (89 loc) · 3.76 KB
/
feedback.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
108
109
110
111
112
113
114
<?PHP
/*
* Copyright (C) 2014 Vinodh Rajan [email protected]
*
* This file is a part of Anunaadam.
*
* Anunaadam is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
* Public License for more details. You should have received a copy of the GNU
* Affero General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
require_once "menu.php";
require_once ('recaptchalib.php');
require_once 'google/appengine/api/mail/Message.php';
use google\appengine\api\mail\Message;
$publickey = "Enter_your_RECAPTCHA_public_key";
$privatekey = "Enter_your_RECAPTCHA_private_key";
include_once "recaptchakeys.php";
$error = null;
if ($_POST ["recaptcha_response_field"]) {
$resp = recaptcha_check_answer ( $privatekey, $_SERVER ["REMOTE_ADDR"], $_POST ["recaptcha_challenge_field"], $_POST ["recaptcha_response_field"] );
if ($resp->is_valid) {
if($_SESSION['lang']=='en')
$msgSent = "<big><big>Your feedback has been received. Thanks</big></big>";
else
$msgSent = "<big><big>தங்களது கருத்து பெறப்பட்டது. நன்றி</big></big>";
$message_body = "From:" . $_POST ["nm"] . "\n\n" . "Email:" . $_POST ["em"] . "\n\n" . $_POST ["ftxt"];
$mail_options = [
"sender" => "[email protected]",
"to" => "[email protected]",
"subject" => "Feedback for Anunaadam",
"textBody" => $message_body
]
;
$message = new Message ( $mail_options );
$message->send ();
} else {
$error = $resp->error;
if($_SESSION['lang']=='en')
$msgError = "<big><big>Incorrect ReCaptcha text. Please try entering the correct text</big></big>";
else
$msgError = "<big><big>ரீ-கேப்ட்சா பிழை. மீண்டும் ரீ-கேப்ட்சா உரையினை சரியான முறையில் உள்ளீடு செய்க</big></big>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Anunaadam : Tamil Transcription Tool</title>
<?PHP echo $jscss; ?>
</head>
<body>
<?PHP echo $header; ?>
<?PHP echo $leftmenu; ?>
<div class="container-cont">
<br />
<div class="uiTran"><?PHP echo lanconTrnL("அனுநாதம் குறித்து கருத்துக்கள், ஆலோசனைகள் ஏதேனும் இருப்பின் தெரியப்படுத்துக:",$_SESSION['lang']); ?></div>
<br />
<form name="vinodh" method="post"
action="feedback">
<div class="uiTran"><?PHP echo lanconTrnL("பெயர்:",$_SESSION['lang']); ?></div>
<input name="nm"
value="<?PHP if(isset($msgError)) echo $_POST["nm"] ?>"></input>
<div class="uiTran"><?PHP echo lanconTrnL("மின்னஞ்சல்:",$_SESSION['lang']); ?></div>
<input name="em"
value="<?PHP if(isset($msgError)) echo $_POST["em"] ?>"></input> <br />
<br />
<textarea cols="50" rows="12" name="ftxt">
<?PHP if(isset($msgError)) echo $_POST["ftxt"]?>
</textarea>
<br />
<?PHP echo recaptcha_get_html($publickey, $error);?>
<br /> <input type="submit"
value="<?PHP echo lanconTrnL("அனுப்புக",$_SESSION['lang']); ?>"
id="send">
</form>
<br />
<?PHP if(isset($msgError)) echo $msgError; ?>
<?PHP if(isset($msgSent)) echo $msgSent; ?>
<br /> <br />
</div>
<?PHP echo $footer; ?>
</body>
</html>