contacts.htm
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Form </title>
<style type="text/css">
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.myform{
margin:0 auto;
width:400px;
padding:14px;
}
/* ----------- basic ----------- */
#basic{
border:solid 2px #DEDEDE;
}
#basic h1 {
font-size:14px;
font-weight:bold;
margin-bottom:8px;
}
#basic p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #dedede;
padding-bottom:10px;
}
#basic label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#basic .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#basic input{
float:left;
width:200px;
margin:2px 0 30px 10px;
}
#basic button{
clear:both;
margin-left:150px;
background:#888888;
color:#FFFFFF;
border:solid 1px #666666;
font-size:11px;
font-weight:bold;
padding:4px 6px;
}
/* ----------- stylized ----------- */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:14px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:160px;
width:125px;
height:31px;
background:#444;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:11px;
font-weight:bold;
}
</style>
</head>
<body>
<div id="stylized" class="myform">
<form id="form1" action="mail.php" method="post">
<label>Име
<span class="small">Вашето Име</span>
</label>
<input type="text" name="name" />
<label>Email
<span class="small">за обратна връзка </span>
</label>
<input type="text" name="email" />
<label>Телефон
<span class="small">за обратна връзка </span>
</label>
<input type="text" name="phone" />
<br />
<br />
<label>Град</label>
<input type="text" name="city" />
<label>Относно
<span class="small">избери целта на запитването</span>
</label>
<select name="type" size="1">
<option value="Нещо не работи">Нещо не работи</option>
<option value="Неверни данни">Неверни данни</option>
<option value="">всичко останало</option>
</select>
<br />
<br />
<br />
<label>Съобщение:
<span class="small">тук напиши съобщението си</span>
</label>
<textarea name="message" rows="6" cols="25"></textarea><br />
<button type="submit" value="Send" style="margin-top:15px;">Submit</button>
<div class="spacer"></div>
</form>
</div>
</body>
</html>
mail.php
PHP:
<meta http-equiv=Content-Type content="text/html; charset=utf-8" />
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$city = $_POST['city'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent="ОТ: $name \n Phone: $phone \n City: $city \n Type: $type \n Message: $message";
$recipient = "scenebg@abv.bg";
$subject = " .$type. \n";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='contacts.htm' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
PHP:
<?php header("Content-type: text/html; charset=windows-1251"); ?>
PHP:
<?php header("Content-type: text/html; charset=utf-8"); ?>