emailadres versleutelen
Helaas krijg ik ook heel veel spam ondanks het captchafilter omdat in 1 van de php bestanden mijn emailadres staat geschreven en de spam gaat dan ook niet via het formulier maar direct naar mijn emailadres.
Kan ik het emailadres versleutelen zodat spamrobots hier niets meer mee kunnen?
erwin schreef op 17.04.2008 14:32:
heb je een script, want een emailadres wordt niet weergeven als je het niet verstuurt naar de browser.
php is sever-side
php is sever-side
Hier is het script:
Code (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?php
//----- Start Config -----\\
// Enter the path to sendmail - should be fine as is in most cases
$mail_path = "/usr/sbin/sendmail";
// Enter the email address you wish emails to be sent to
$mail_to = "[email protected]";
// Recipient should be selected from a list, true or false
$listofrecipients = false;
// Sub variable (only edit if above value is set to true)
// Define list of recipients the user can chose from. Name & Email address should be seperated by ><
// Will override $mail_to value above
$recipientslist = array("Name 1 >< [email protected]", "Name 2 >< [email protected]", "Name 3 >< [email protected]");
// Subject should be selected from a list, true or false
$listofsubjects = false;
// Sub variable (only edit if above value is set to true)
// Define list of subjects the user can chose from
$subjects = array("Subject 1", "Subject 2", "Subject 3");
// Use security code feature, true or false
$usesecuritycode = true;
// Use time limit feature, true or false
$usetimelimit = false;
// Sub variable (only edit if above value is set to true)
// Set time delay if using time limit feature in seconds
$delay = "0";
// Redirect to another page after successful submission, true or false
$redirectonsuccess = false;
// Sub variable (only edit if above value is set to true)
// Set address of page to redirect to after successful submission, can be relative
$redirecturl = "http://www.marcelshondenpagina.nl";
// Allow user to get a copy of the message sent to them, true or false
$copyme = false;
// Store submissions in a database, true or false
$store = false;
// Sub variables (only edit if above value is set to true
// MySQL Host
$host = "localhost";
// MySQL User
$user = "user";
// MySQL Pass
$pass = "pass";
// MySQL Database Name
$dbname = "name";
// Table Name
$tablename = "ContactFormLog";
// Date Format, see http://www.php.net/date
$dateformat = "d/m/Y H:i:s";
// User has to preview before can submit, true or false
$preview = false;
// Remember user's name and e-mail, true or false
$rememberdetails = false;
// Sub variables (only edit if above value is set to true
// Days to remember details for
$rememberdays = 0;
//----- End Config -----\\
//----- Start Set PHP Variables -----\\
ini_set("sendmail_path", $mail_path);
ini_set("magic_quotes_gpc", 1);
//----- End Set PHP Variables -----\\
//----- Start Functions -----\\
// Function to check email format
function check_email($str)
{
return 1;
}
// Function to get submitted values
function get_values($slashes,$decode)
{
global $userName;
global $userEmail;
global $userSubject;
global $userMessage;
global $userCopyMe;
global $userEmailTo;
global $rememberdetails;
$userName = htmlentities(strip_tags($_POST['userName']));
$userEmail = htmlentities(strip_tags($_POST['userEmail']));
$userSubject = htmlentities(strip_tags($_POST['userSubject']));
$userMessage = htmlentities(strip_tags($_POST['userMessage']));
$userCopyMe = htmlentities(strip_tags($_POST['userCopyMe']));
$userEmailTo = htmlentities(strip_tags($_POST['userEmailTo']));
if ($slashes) {
$userName = stripslashes($userName);
$userEmail = stripslashes($userEmail);
$userSubject = stripslashes($userSubject);
$userMessage = stripslashes($userMessage);
$userCopyMe = stripslashes($userCopyMe);
$userEmailTo = stripslashes($userEmailTo);
}
if ($decode) {
$userName = html_entity_decode($userName);
$userEmail = html_entity_decode($userEmail);
$userSubject = html_entity_decode($userSubject);
$userMessage = html_entity_decode($userMessage);
$userCopyMe = html_entity_decode($userCopyMe);
$userEmailTo = html_entity_decode($userEmailTo);
}
}
// Function to clear submitted values
function clear_values()
{
global $userName;
global $userEmail;
global $userSubject;
global $userMessage;
global $userCopyMe;
global $userEmailTo;
global $rememberdetails;
if (!$rememberdetails) {
$userName = "";
$userEmail = "";
}
$userSubject = "";
$userMessage = "";
$userCopyMe = "";
$userEmailTo = "";
}
// Function to display message
function display_messages()
{
global $message;
global $messagenoterror;
$y = "0";
if (!empty($message) && $messagenoterror != 1) {
echo "<div class=\"error\">De volgende fout(en) werd(en) gemaakt:<ul>";
} elseif (!empty($message) && $messagenoterror == 1) {
echo "<div class=\"success\">";
}
while ($y < 10) {
if (!empty($message[$y])) {
if ($messagenoterror != 1) {
echo "<li>";
}
echo $message[$y];
if ($messagenoterror != 1) {
echo "</li>";
}
}
$y++;
}
if (!empty($message) && $messagenoterror != 1) {
echo "</ul>";
}
if (!empty($message)) {
echo "</div>";
}
}
//----- End Functions -----\\
//----- Start Set Variables -----\\
$mail_subject = $_POST['userSubject'];
$submittime = $_SESSION['submittime'];
$currenttime = time();
$allowedtime = $currenttime - $delay;
$timeleft = $submittime - $allowedtime;
$p = 0;
get_values(1,1);
$EmailContent = "Name:\n".$userName."\n\n"."Email:\n".$userEmail."\n\n"."Subject:\n".$userSubject."\n\n"."Message:\n".$userMessage."\n\n"."User Agent:\n".$_SERVER["HTTP_USER_AGENT"]."\n\n"."User IP:\n".$_SERVER["REMOTE_ADDR"];
//----- End Set Variables -----\\
// Check if form submitted and token valid
if ($_POST && isset($_SESSION['token']) && $_POST['fldToken'] == $_SESSION['token']){
//----- Start Error Checking -----\\
// Check to see if fields already been checked
if ($_POST['previewdone'] != "1") {
// Check if all fields filled in
if (!$_POST['userName'] || !$_POST['userEmail'] || !$_POST['userSubject'] || !$_POST['userMessage']){
$message[$p] = "De verplichte velden zijn leeg.";
$p++;
get_values(1,0);
$notcomplete = 1;
}
// Check if email is in valid format
if (check_email($_POST['userEmail']) == "0" && $_POST['userEmail']){
$message[$p] = "ongeldig emailadres.";
$p++;
get_values(1,0);
}
// Check if security code is correct
if ($_POST['userSecurityCode'] != $_SESSION['captcha'] && $usesecuritycode && $notcomplete != "1"){
$message[$p] = "Foute code.";
$p++;
get_values(1,0);
}
// Check that x seconds has passed
if ($submittime > $allowedtime && $usetimelimit){
// Uncomment the following line and comment the line after if you wish to display the time they have to wait before they can send another message
//$message[$p] = "U probeert te vaak een bericht te sturen, probeer het opnieuw na ".$timeleft." seconds";
$message[$p] = "U probeert te vaak een bericht te sturen, probeer het later nog eens.";
$p++;
get_values(1,0);
}
}
//----- End Error Checking -----\\
//----- Start Set Cookies ------\\
if ($rememberdetails) {
$cookietime = time()+60*60*24*$rememberdays;
// Set cookie to remember userid for x days
setcookie("userName", $_POST['userName'], $cookietime, "/");
// Set cookie to remember password for x days
setcookie("userEmail", $_POST['userEmail'], $cookietime, "/");
}
//----- End Set Cookies ------\\
//----- Start Final Check & Process Form ------\\
if ($preview && $_POST['previewdone'] == 1) {
if ($submittime > $allowedtime && $usetimelimit) {
$continue = 0;
// Clear form values
clear_values();
} else {
$continue = 1;
}
} elseif ($preview && $_POST['previewdone'] != 1) {
$continue = 0;
} else {
$continue = 1;
}
// Check to see whether there are any errors, if no then continue
if (empty($message) && $continue == 1 && empty($_POST['edit'])){
// Check to see whether the user can pick the recipitent, if yes get recepitent chosen
if ($listofrecipients) {
$explodedresult = explode(" >< ", $recipientslist[$_POST['userEmailTo']]);
$mail_to = $explodedresult[1];
}
// Check to see if mail sent correctly
get_values(1,0);
if(mail($mail_to,$mail_subject,$EmailContent,"From: Marcel Website <[email protected]>")){
// Check to see if user wants a copy of the message, if yes send them one
if ($_POST['userCopyMe'] == "1"){
mail($_POST['userEmail'],"Copy of sent message: ".$mail_subject,$EmailContent,"From:".$userName." <".$userEmail.">");
}
// Check to see if user wants to store submissions
if ($store) {
// Connect to db
$connect = @mysql_connect($host,$user,$pass);
// Select db
$selectdb = @mysql_select_db($dbname);
// Get variables
get_values(1,1);
$userAgent = $_SERVER["HTTP_USER_AGENT"];
$userIP = $_SERVER["REMOTE_ADDR"];
$userTime = date($dateformat);
// Insert data
$sql = "INSERT INTO `$tablename` (`ID`, `userName`, `userEmail`, `userSubject`, `userMessage`, `userCopyMe`, `userEmailTo`, `userAgent`, `userIP`, `userTime`) VALUES ('', '$userName', '$userEmail', '$userSubject', '$userMessage', '$userCopyMe', '$mail_to', '$userAgent', '$userIP', '$userTime')";
$result = @mysql_query($sql);
}
// Tell user message sent successfully
$message[0] = "Uw bericht is verzonden.";
$messagenoterror = 1;
// Clear form values
clear_values();
// Store submit time for use with time limit feature
$_SESSION['submittime'] = time();
// Check to see if user should be redirected
if ($redirectonsuccess) {
?>
//----- Start Config -----\\
// Enter the path to sendmail - should be fine as is in most cases
$mail_path = "/usr/sbin/sendmail";
// Enter the email address you wish emails to be sent to
$mail_to = "[email protected]";
// Recipient should be selected from a list, true or false
$listofrecipients = false;
// Sub variable (only edit if above value is set to true)
// Define list of recipients the user can chose from. Name & Email address should be seperated by ><
// Will override $mail_to value above
$recipientslist = array("Name 1 >< [email protected]", "Name 2 >< [email protected]", "Name 3 >< [email protected]");
// Subject should be selected from a list, true or false
$listofsubjects = false;
// Sub variable (only edit if above value is set to true)
// Define list of subjects the user can chose from
$subjects = array("Subject 1", "Subject 2", "Subject 3");
// Use security code feature, true or false
$usesecuritycode = true;
// Use time limit feature, true or false
$usetimelimit = false;
// Sub variable (only edit if above value is set to true)
// Set time delay if using time limit feature in seconds
$delay = "0";
// Redirect to another page after successful submission, true or false
$redirectonsuccess = false;
// Sub variable (only edit if above value is set to true)
// Set address of page to redirect to after successful submission, can be relative
$redirecturl = "http://www.marcelshondenpagina.nl";
// Allow user to get a copy of the message sent to them, true or false
$copyme = false;
// Store submissions in a database, true or false
$store = false;
// Sub variables (only edit if above value is set to true
// MySQL Host
$host = "localhost";
// MySQL User
$user = "user";
// MySQL Pass
$pass = "pass";
// MySQL Database Name
$dbname = "name";
// Table Name
$tablename = "ContactFormLog";
// Date Format, see http://www.php.net/date
$dateformat = "d/m/Y H:i:s";
// User has to preview before can submit, true or false
$preview = false;
// Remember user's name and e-mail, true or false
$rememberdetails = false;
// Sub variables (only edit if above value is set to true
// Days to remember details for
$rememberdays = 0;
//----- End Config -----\\
//----- Start Set PHP Variables -----\\
ini_set("sendmail_path", $mail_path);
ini_set("magic_quotes_gpc", 1);
//----- End Set PHP Variables -----\\
//----- Start Functions -----\\
// Function to check email format
function check_email($str)
{
return 1;
}
// Function to get submitted values
function get_values($slashes,$decode)
{
global $userName;
global $userEmail;
global $userSubject;
global $userMessage;
global $userCopyMe;
global $userEmailTo;
global $rememberdetails;
$userName = htmlentities(strip_tags($_POST['userName']));
$userEmail = htmlentities(strip_tags($_POST['userEmail']));
$userSubject = htmlentities(strip_tags($_POST['userSubject']));
$userMessage = htmlentities(strip_tags($_POST['userMessage']));
$userCopyMe = htmlentities(strip_tags($_POST['userCopyMe']));
$userEmailTo = htmlentities(strip_tags($_POST['userEmailTo']));
if ($slashes) {
$userName = stripslashes($userName);
$userEmail = stripslashes($userEmail);
$userSubject = stripslashes($userSubject);
$userMessage = stripslashes($userMessage);
$userCopyMe = stripslashes($userCopyMe);
$userEmailTo = stripslashes($userEmailTo);
}
if ($decode) {
$userName = html_entity_decode($userName);
$userEmail = html_entity_decode($userEmail);
$userSubject = html_entity_decode($userSubject);
$userMessage = html_entity_decode($userMessage);
$userCopyMe = html_entity_decode($userCopyMe);
$userEmailTo = html_entity_decode($userEmailTo);
}
}
// Function to clear submitted values
function clear_values()
{
global $userName;
global $userEmail;
global $userSubject;
global $userMessage;
global $userCopyMe;
global $userEmailTo;
global $rememberdetails;
if (!$rememberdetails) {
$userName = "";
$userEmail = "";
}
$userSubject = "";
$userMessage = "";
$userCopyMe = "";
$userEmailTo = "";
}
// Function to display message
function display_messages()
{
global $message;
global $messagenoterror;
$y = "0";
if (!empty($message) && $messagenoterror != 1) {
echo "<div class=\"error\">De volgende fout(en) werd(en) gemaakt:<ul>";
} elseif (!empty($message) && $messagenoterror == 1) {
echo "<div class=\"success\">";
}
while ($y < 10) {
if (!empty($message[$y])) {
if ($messagenoterror != 1) {
echo "<li>";
}
echo $message[$y];
if ($messagenoterror != 1) {
echo "</li>";
}
}
$y++;
}
if (!empty($message) && $messagenoterror != 1) {
echo "</ul>";
}
if (!empty($message)) {
echo "</div>";
}
}
//----- End Functions -----\\
//----- Start Set Variables -----\\
$mail_subject = $_POST['userSubject'];
$submittime = $_SESSION['submittime'];
$currenttime = time();
$allowedtime = $currenttime - $delay;
$timeleft = $submittime - $allowedtime;
$p = 0;
get_values(1,1);
$EmailContent = "Name:\n".$userName."\n\n"."Email:\n".$userEmail."\n\n"."Subject:\n".$userSubject."\n\n"."Message:\n".$userMessage."\n\n"."User Agent:\n".$_SERVER["HTTP_USER_AGENT"]."\n\n"."User IP:\n".$_SERVER["REMOTE_ADDR"];
//----- End Set Variables -----\\
// Check if form submitted and token valid
if ($_POST && isset($_SESSION['token']) && $_POST['fldToken'] == $_SESSION['token']){
//----- Start Error Checking -----\\
// Check to see if fields already been checked
if ($_POST['previewdone'] != "1") {
// Check if all fields filled in
if (!$_POST['userName'] || !$_POST['userEmail'] || !$_POST['userSubject'] || !$_POST['userMessage']){
$message[$p] = "De verplichte velden zijn leeg.";
$p++;
get_values(1,0);
$notcomplete = 1;
}
// Check if email is in valid format
if (check_email($_POST['userEmail']) == "0" && $_POST['userEmail']){
$message[$p] = "ongeldig emailadres.";
$p++;
get_values(1,0);
}
// Check if security code is correct
if ($_POST['userSecurityCode'] != $_SESSION['captcha'] && $usesecuritycode && $notcomplete != "1"){
$message[$p] = "Foute code.";
$p++;
get_values(1,0);
}
// Check that x seconds has passed
if ($submittime > $allowedtime && $usetimelimit){
// Uncomment the following line and comment the line after if you wish to display the time they have to wait before they can send another message
//$message[$p] = "U probeert te vaak een bericht te sturen, probeer het opnieuw na ".$timeleft." seconds";
$message[$p] = "U probeert te vaak een bericht te sturen, probeer het later nog eens.";
$p++;
get_values(1,0);
}
}
//----- End Error Checking -----\\
//----- Start Set Cookies ------\\
if ($rememberdetails) {
$cookietime = time()+60*60*24*$rememberdays;
// Set cookie to remember userid for x days
setcookie("userName", $_POST['userName'], $cookietime, "/");
// Set cookie to remember password for x days
setcookie("userEmail", $_POST['userEmail'], $cookietime, "/");
}
//----- End Set Cookies ------\\
//----- Start Final Check & Process Form ------\\
if ($preview && $_POST['previewdone'] == 1) {
if ($submittime > $allowedtime && $usetimelimit) {
$continue = 0;
// Clear form values
clear_values();
} else {
$continue = 1;
}
} elseif ($preview && $_POST['previewdone'] != 1) {
$continue = 0;
} else {
$continue = 1;
}
// Check to see whether there are any errors, if no then continue
if (empty($message) && $continue == 1 && empty($_POST['edit'])){
// Check to see whether the user can pick the recipitent, if yes get recepitent chosen
if ($listofrecipients) {
$explodedresult = explode(" >< ", $recipientslist[$_POST['userEmailTo']]);
$mail_to = $explodedresult[1];
}
// Check to see if mail sent correctly
get_values(1,0);
if(mail($mail_to,$mail_subject,$EmailContent,"From: Marcel Website <[email protected]>")){
// Check to see if user wants a copy of the message, if yes send them one
if ($_POST['userCopyMe'] == "1"){
mail($_POST['userEmail'],"Copy of sent message: ".$mail_subject,$EmailContent,"From:".$userName." <".$userEmail.">");
}
// Check to see if user wants to store submissions
if ($store) {
// Connect to db
$connect = @mysql_connect($host,$user,$pass);
// Select db
$selectdb = @mysql_select_db($dbname);
// Get variables
get_values(1,1);
$userAgent = $_SERVER["HTTP_USER_AGENT"];
$userIP = $_SERVER["REMOTE_ADDR"];
$userTime = date($dateformat);
// Insert data
$sql = "INSERT INTO `$tablename` (`ID`, `userName`, `userEmail`, `userSubject`, `userMessage`, `userCopyMe`, `userEmailTo`, `userAgent`, `userIP`, `userTime`) VALUES ('', '$userName', '$userEmail', '$userSubject', '$userMessage', '$userCopyMe', '$mail_to', '$userAgent', '$userIP', '$userTime')";
$result = @mysql_query($sql);
}
// Tell user message sent successfully
$message[0] = "Uw bericht is verzonden.";
$messagenoterror = 1;
// Clear form values
clear_values();
// Store submit time for use with time limit feature
$_SESSION['submittime'] = time();
// Check to see if user should be redirected
if ($redirectonsuccess) {
?>
<script type="text/javascript">
<!--
window.location.href = "";
-->
</script>
Code (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
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
<?php
}
// If error provide link
}else{
// Provide link to user to send using their default email
$message[0] = "Er is een fout opgetreden. Klik <a href=\"mailto:".$mail_to."?subject=".$_POST['userSubject']."&body=".$_POST['userMessage']."\">here</a> om het bericht via uw standaard email programma te versturen.";
$messagenoterror = 1;
get_values(1,0);
}
$formsent = "1";
}
} else {
if ($rememberdetails) {
$userName = $_COOKIE['userName'];
$userEmail = $_COOKIE['userEmail'];
}
}
//----- End Final Check & Process Form ------\\
// Set token to make sure user can only post to form from this script
$token = md5(uniqid(rand(), true));
$_SESSION['token'] = $token;
//----- Start Output -----\\
if ($preview && $_POST['previewfirst'] == "1" && $formsent != "1" && empty($message) && empty($_POST['edit'])) {
get_values(1,0);
//----- Start Preview -----\\
?>
}
// If error provide link
}else{
// Provide link to user to send using their default email
$message[0] = "Er is een fout opgetreden. Klik <a href=\"mailto:".$mail_to."?subject=".$_POST['userSubject']."&body=".$_POST['userMessage']."\">here</a> om het bericht via uw standaard email programma te versturen.";
$messagenoterror = 1;
get_values(1,0);
}
$formsent = "1";
}
} else {
if ($rememberdetails) {
$userName = $_COOKIE['userName'];
$userEmail = $_COOKIE['userEmail'];
}
}
//----- End Final Check & Process Form ------\\
// Set token to make sure user can only post to form from this script
$token = md5(uniqid(rand(), true));
$_SESSION['token'] = $token;
//----- Start Output -----\\
if ($preview && $_POST['previewfirst'] == "1" && $formsent != "1" && empty($message) && empty($_POST['edit'])) {
get_values(1,0);
//----- Start Preview -----\\
?>
<form method="post" action="">
<p>
Name
<br />
<input type="hidden" name="userName" value="" />
</p>
<p>
<br />
<input type="hidden" name="userEmail" value="" />
</p>
<p>
Recipient
<br />
Code (php)
<input type="hidden" name="userEmailTo" value="" />
</p>
<p>
Subject
<br />
<input type="hidden" name="userSubject" value="" />
</p>
<p>
Message
<br />
<input type="hidden" name="userMessage" value="" />
</p>
<p>
Send me a copy of the message?
<br />
<input type="hidden" name="userCopyMe" value="" />
</p>
<p>
<input type="submit" name="edit" value="Edit" /> <input type="submit" name="submit" value="Send" />
<input type="hidden" name="previewdone" value="1" /><input type="hidden" name="fldToken" value="" />
</p>
</form>
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
<?php
//----- End Preview -----\\
} else {
//----- Start Form -----\\
// Display any messages
display_messages();
?>
//----- End Preview -----\\
} else {
//----- Start Form -----\\
// Display any messages
display_messages();
?>
<form method="post" action="">
<p>
<label for="userName">Naam</label>
<br />
<input type="text" name="userName" id="userName" value="" />
</p>
<p>
<label for="userEmail">Email</label>
<br />
<input type="text" name="userEmail" id="userEmail" value="" />
</p>
<p>
<label for="userEmailTo">Recipient</label>
<br />
<select name="userEmailTo" id="userEmailTo">
Code (php)
<option value="" ></option>
</select>
</p>
<p>
<label for="userSubject">Onderwerp</label>
<br />
<input type="text" name="userSubject" id="userSubject" value="" />
<select name="userSubject" id="userSubject">
<option value="" ></option>
</select>
</p>
<p>
<label for="userMessage">Bericht</label>
<br />
<textarea name="userMessage" id="userMessage" rows="4" cols="30"></textarea>
</p>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
//check to see if security code feature is on
if ($usesecuritycode) {
// generate random string
function Random_String($length) {
srand((double)microtime()*1000000);
$string = md5(rand(0,9999));
$string = substr($string, 17, $length);
return($string);
}
if (empty($_SESSION['valid']) || $_SESSION['valid'] != 2) {
$codeLength = 6;
$_SESSION['captcha'] = Random_String($codeLength);
}
?>
//check to see if security code feature is on
if ($usesecuritycode) {
// generate random string
function Random_String($length) {
srand((double)microtime()*1000000);
$string = md5(rand(0,9999));
$string = substr($string, 17, $length);
return($string);
}
if (empty($_SESSION['valid']) || $_SESSION['valid'] != 2) {
$codeLength = 6;
$_SESSION['captcha'] = Random_String($codeLength);
}
?>
<p>
<label for="userSecurityCode">Druk op F5 en typ de code over.</label>
<br />
<input type="text" name="userSecurityCode" id="userSecurityCode" maxlength="" />
</p>
<p>
<img src="gd.php" alt="Security Code" />
</p>
<p>
<label for="userCopyMe">Aanvinken als u een kopie wilt ontvangen van dit bericht.</label>
<br />
<input type="checkbox" name="userCopyMe" id="userCopyMe" value="1" />
</p>
<p>
<input type="submit" name="submit" value="" />
<input type="hidden" name="previewfirst" value="1" />
<input type="hidden" name="fldToken" value="" />
</p>
</form>
</table>
</div>
</table>
</div>
Misschien volgende keer een relevant stukje script plaatsen?
Gewijzigd op 01/01/1970 01:00:00 door Jelle Posthuma
Maarja, enigste wat ik zo snel zie is dat je de e-mail adres laat zien wanneer de mail() functie faalt, misschien een idee om deze er uit te halen?
Verder, weet je het wel zeker dat men via deze form naar jouw mail adres sturen? bijv. heb je op geen ander plek dit mail adres neergezet?
Riemer schreef op 17.04.2008 15:34:
Wel een monster van een script niet?
Maarja, enigste wat ik zo snel zie is dat je de e-mail adres laat zien wanneer de mail() functie faalt, misschien een idee om deze er uit te halen?
Verder, weet je het wel zeker dat men via deze form naar jouw mail adres sturen? bijv. heb je op geen ander plek dit mail adres neergezet?
Maarja, enigste wat ik zo snel zie is dat je de e-mail adres laat zien wanneer de mail() functie faalt, misschien een idee om deze er uit te halen?
Verder, weet je het wel zeker dat men via deze form naar jouw mail adres sturen? bijv. heb je op geen ander plek dit mail adres neergezet?
Oke, hoe haal ik dat eruit?
En nee, nergens is mijn email te zien voor de rest.
Sorry voor het lange script trouwens...
Code (php)
1
$message[0] = "Er is een fout opgetreden. Klik <a href=\"mailto:".$mail_to."?subject=".$_POST['userSubject']."&body=".$_POST['userMessage']."\">here</a> om het bericht via uw standaard email programma te versturen.";
Dit stukje staat ergens in je script, zoals je kan zien wordt hier in klare HTML vorm je e-mail adres neer gezet. Dit kun je of veranderen (gewoon foutmelding neerzetten), of de gehele regel verwijderen.
Gewijzigd op 01/01/1970 01:00:00 door Riemer
Riemer schreef op 17.04.2008 15:56:
Dit stukje staat ergens in je script, zoals je kan zien wordt hier in klare HTML vorm je e-mail adres neer gezet. Dit kun je of veranderen (gewoon foutmelding neerzetten), of de gehele regel verwijderen.
Code (php)
1
$message[0] = "Er is een fout opgetreden. Klik <a href=\"mailto:".$mail_to."?subject=".$_POST['userSubject']."&body=".$_POST['userMessage']."\">here</a> om het bericht via uw standaard email programma te versturen.";
Dit stukje staat ergens in je script, zoals je kan zien wordt hier in klare HTML vorm je e-mail adres neer gezet. Dit kun je of veranderen (gewoon foutmelding neerzetten), of de gehele regel verwijderen.
Oke, ik haal de hele regel weg en dan kijk ik of ik wat minder spam krijg.
Dank u!