-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfeedback.php
40 lines (36 loc) · 1.02 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
<?php
if(isset($_POST['feedbackMessage']) && trim($_POST['feedbackMessage']) != ''){
if(isset($_POST['name']) && trim($_POST['name']) != '')
$fromName= $_POST['name'];
else
$fromName= false;
if(isset($_POST['email']) && trim($_POST['email']) != '')
$fromMail= $_POST['email'];
else
$fromMail= '[email protected]';
$from= ($fromName)? $fromName." <".$fromMail.">": $fromMail;
$m= mail("[email protected]",
"[felipenmoura.org/root3d] - Feedback",
$_POST['feedbackMessage'],
'From: '.$from . "\r\n" .
'Reply-To: '.$fromMail . "\r\n");
if($m){
?>
<script>
alert('Hey, thank you for your feedback!');
</script>
<?php
}else{
?>
<script>
alert('Holly c***! Something went wrong and the message has not been sent! Please, try again later, and sorry for that!');
</script>
<?php
}
}else{
?>
<script>
alert('Please, fill out the form correctly, so I can get in touch if required so, and read your useful feedback!');
</script>
<?php
}