Forum Moderators: coopster
<?php
// if submitted form
if ($_SERVER['REQUEST_METHOD'] == "POST") {
// strip out HTML tags
$realname = strip_tags($realname);
$email = strip_tags($email);
$feedback = strip_tags($feedback);
// set the variables
$sendto = "myemail@myhost.com";
$subject = "Feedback recieved";
$message = "$realname, $email\n\n$feedback";
// send the email
mail($sendto, $subject, $message );
}
?>
<html>
<head>
<title>Feedback Form</title>
</head>
<body bgcolor="#FFFFFF">
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$realname = $_POST['realname'];
$email = $_POST['email'];
$feedback = $_POST['feedback'];
echo("<p><b>Thank you for your feedback.</b></p>\n");
echo("<blockquote><pre>\n");
echo("$feedback");
echo("</pre></blockquote>");
}
else {
?>
<!-- *** start form -->
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="POST">
<table cellpadding="4" cellspacing="0" border="0">
<tr><td><b>Name: </b></td><td><input type="text" name="realname" size="25"></td></tr>
<tr><td><b>Email:</b></td><td><input type="text" name="email" size="25"></td></tr>
<tr><td colspan=2><b>Feedback:</b><br />
<textarea name="feedback" rows="4" cols="40" wrap="physical"></textarea>
</td></tr>
<tr><td colspan="2" align="right"><input type="submit" value="Send Feedback"></td></tr>
</table>
</form>
<!-- *** end form -->
<?php } ?>
</body>
</html>
And when i send an email containing a Bulgarian word i get
фдгф etc...
My mailbox accepts only text/plain
I've tried a lot of options, but nothing didn't worked
Help would be greatly appreciated
Edit:I have a typo in the title
Not related to your question but, you have:
if ($_SERVER['REQUEST_METHOD'] == "POST") {
twice...is this necessary?
ps
От къде сте? София?
Should be - Ot kade ste? Sofia?
Edit
I see the Bulgarian words did not come out correctly .... :(
I'm not the one that would recieve those emails so my customers need to see it clearly and understand it, not seeing escaped text :)
In gave the escaped text as an example - it's not a word but some nonsence
I was asking for a way of somehow encoding the output to utf-8