<!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>
<title>Emailing Form Data</title>
<style type="text/css">
code {color:#F00C4D;font-weight:bold;font-size:1.2em}
i {color: #6D0CF0}
th, td {padding:.1em;border:1px solid blue;text-align:left}
</style>
</head>
<body>
<?php
//This is a very simple PHP script that outputs the name of each bit of information (that corresponds to the <code>name</code> attribute for that field) along with the value that was sent with it right in the browser window, and then sends it all to an email address (once you've added it to the script).
if (empty($_POST)) {
print "<p>No data was submitted.</p>";
print "</body></html>";
exit();
}
//Creates function that removes magic escaping, if it's been applied, from values and then removes extra newlines and returns to foil spammers. Thanks Larry Ullman!
function clear_user_input($value) {
if (get_magic_quotes_gpc()) $value=stripslashes($value);
$value= str_replace( "\n", '', trim($value));
$value= str_replace( "\r", '', $value);
return $value;
}
if ($_POST['comments'] == 'Please share any comments you have here') $_POST['comments'] = '';
//Create body of message by cleaning each field and then appending each name and value to it
$body ="Here is the data that was submitted:\n";
foreach ($_POST as $key => $value) {
$key = clear_user_input($key);
$value = clear_user_input($value);
if ($key=='extras') {
if (is_array($_POST['extras']) ){
$body .= "$key: ";
$counter =1;
foreach ($_POST['extras'] as $value) {
//Add comma and space until last element
if (sizeof($_POST['extras']) == $counter) {
$body .= "$value\n";
break;}
else {
$body .= "$value, ";
$counter += 1;
}
}
} else {
$body .= "$key: $value\n";
}
} else {
$body .= "$key: $value\n";
}
}
extract($_POST);
//removes newlines and returns from $email and $name so they can't smuggle extra email addresses for spammers
$email = clear_user_input($email);
$name = clear_user_input($name);
//Create header that puts email in From box along with name in parentheses and sends bcc to alternate address
$from='From: '. $email . "(" . $name . ")" . "\r\n" . 'Bcc: yourmail@yourdomain.com' . "\r\n";
//Creates intelligible subject line that also shows me where it came from
$subject = 'Bed Order from Web Site';
//Sends mail to me, with elements created above
mail ('youremail@yourdomain.com', $subject, $body, $from);
?>
<p>Thanks for your order! We'll send your bed right away.</p>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
html的代码
共543个文件
html:278个
css:116个
jpg:82个
需积分: 3 1 下载量 192 浏览量
2008-05-30
15:11:48
上传
评论
收藏 1.73MB ZIP 举报
温馨提示
html的代码大家来支持下
资源推荐
资源详情
资源评论
收起资源包目录
html的代码 (543个子文件)
Clock2.class 4KB
allformatting-hideextralinks.css 2KB
allformatting-hideheader.css 2KB
allformatting.css 2KB
allformatting.css 2KB
mainform.css 1KB
tabledisplay.css 1KB
colspannew.css 1KB
spacenew.css 1KB
background.css 889B
gaudistyles.css 838B
bgcolor_html.css 707B
text.css 702B
text.css 702B
decoration.css 667B
dropdownformat.css 662B
align.css 615B
nest.css 562B
smallcaps.css 520B
texttransform.css 495B
multiple.css 494B
textalign.css 465B
dropdownonly.css 424B
whitespace.css 404B
indents.css 385B
letterspacing.css 366B
handheld.css 363B
fieldset.css 363B
padding-screen.css 362B
frame.css 352B
background.css 344B
color.css 342B
tbody.css 323B
lineheight.css 292B
margin.css 287B
screen.css 282B
fontsize.css 276B
fontsize-relative.css 275B
float.css 254B
col.css 245B
printurl.css 233B
testpage.css 230B
font.css 219B
colgroup.css 208B
wrap.css 207B
bold.css 202B
center.css 188B
blueflax.css 185B
blueflax.css 185B
blueflax_quirky.css 184B
button.css 184B
radio.css 167B
plegend.css 158B
relative.css 153B
width_bigger.css 153B
width_toosmall.css 153B
width.css 153B
nested.css 149B
checkboxes.css 141B
label.css 139B
orphans.css 137B
border.css 132B
italic.css 129B
border_none.css 125B
width.css 121B
position.css 120B
simple.css 118B
background-individual.css 117B
pagebreaks.css 115B
submit.css 112B
state.css 111B
border.css 110B
background-screen.css 108B
imagereplacement.css 104B
fontfamily-alternate.css 104B
liststyle.css 102B
legend.css 100B
estils.css 97B
custommarkers.css 92B
textarea.css 81B
absolute.css 79B
specificity.css 76B
base_comments.css 73B
logo.css 72B
base_comments2.css 72B
fontfamily.css 72B
float.css 71B
fixed.css 56B
hide.css 55B
background.css 55B
slides.css 50B
definitionlists.css 50B
cursor.css 49B
overflow.css 43B
z-index.css 42B
print.css 40B
vertical-align.css 39B
subsup.css 37B
firstchild.css 35B
padding.css 32B
共 543 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
fengwenqiang
- 粉丝: 6
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功