如何创建发送您的信息表单 [英] How to create Send your info form
问题描述
我是HTML& PHP&我希望通过发送您的信息表获得一些帮助。
我创建了sendyourinfo.html页面,在线测试后,我无法获得所有必需的信息电子邮件。
以下是页码:
<!DOCTYPE html PUBLIC - / / W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns = http://www.w3.org/1999/xhtml\">
< head>
< meta http-equiv =Content-Type内容=text / html; charset = utf-8/>
< title>联系我们 - 目标的和谐< / title>
< link href = oneColLiqCtrHdr.css =stylesheettype =text / css/>
< style type =text / css>
< ! -
身体{
背景颜色:#838383;
}
身体,td,th {
font-family:Eras Medium ITC,Georgia,Calibri;
}
.style1 {font-size:small}
.style 2 {font-size:medium}
.style3 {font-size:x-large}
- >
< /风格>
< script type =text / javascript>
<! -
函数MM_swapImgRestore(){// v3.0
var i,x,a = document.MM_sr; for(i = 0; a&& i< a.length&&(x>}
函数MM_preloadImages(){// v3.0
var d = document; if(d.images){if(!d.MM_p)d.MM_p = new Array();
var i,j = d.MM_p.length,a = MM_preloadImages.arguments ; for(i = 0; i< a.length;> if(a [i] .indexOf(#)!= 0){d.MM_p [j] = new Image; d.MM_p [j ++]。 src = a [i];}}
}
函数MM_findObj(n,d){// v4.01
var p,i,x; if(!d)d = document; if((p = n.indexOf(?))> 0&& parent.frames.length){
d = parent.frames [n.substring(p + 1)]。document; n = n.substring(0,p);}
if(!(x = d) [n])&& d.all)x = d.all [n]; for(i = 0;!x&& i< d.forms.length; i ++)> for(i = 0; !x&& d.layers&& i< d.layers.length; i ++)> if(!x&& d.getElementById)x = d.getElementById(n); return x;
}
函数MM_swapImage(){// v3.0
var i,j = 0,x,a = MM_swapImage.arguments; document.MM_sr = new Array; for(i = 0; i< (a.length-2); i + = 3)
if((x = MM_findObj(a [i]))!= null){document.MM_sr [j ++] = x; if(!x.oSrc)x.oSrc = x.src; x.src = a [i + 2];}
}
// - >
< / script>
< / head>
< body class =oneColLiqCtrHdronload =MM_preloadImages('buttons / home2en.jpg','buttons /aboutus2en.jpg','buttons/ourservices2en.jpg','buttons/sendyourinfo2en.jpg','buttons/contactus2en.jpg','buttons/arabic2en.jpg')\">
<! - 结束#header - >
< img src =logo.jpgalt =width =986height =251/>
如果你正在寻找f或者新工作或想要更改当前的工作,我们建议填写以下表格向我们提供您的信息:
< form action =sendyourinfo-en.phpmethod =postenctype =multipart / form-data >
申请工作表格
| |
名称 | < label> < input type =textname =fullnameid =tswnamesize =24/> < / label> |
性别 | < label> < select name =GenderListid =GenderList> < option value =选择一个>选择一个...< / option> ; < option value =male>男< / option> < option value =female>女< / option> < / select> ; < / label> |
Bith年的日期 | < input name =DOBtype =textid =DOBsize =4maxlength =4/> |
国籍 | < input type =textname =国籍id =国籍/> |
当前城市 | < input type =textname =CurrentCityid =CurrentCity/> |
移动号码 | <输入名称=MobNotype =textid =MobNomaxlength =20/> |
电子邮件 | < input type =textid =tswemailname =emailsize =24/> |
体验年 | <输入名称=ExpY eartype =textid =ExpYearssize =2maxlength =2/> |
Experiense字段 | < label> < select name =ExpListid =ExpList> < option value =choose一个selected =选中>选择一个......< /选项> < option value =mngmt-gm>管理 - GM< /选项> < option value =mngmt-others> Management - Others< / option> < option value =hr-manager> HR - Manager< / option> < option value =hr-admin> HR - Admin< / option> < / select> < / label> |
上传你的简历 | < label> < ; input name =fileuploadtype =fileid =fileuploadsize =24/> < / label> |
< input type =resetname =Clearid =清除value =清除/> <输入名称=提交类型=提交值=发送/> |
< label for =tswname>
< / label>
< / form>
<! - end #container - >
< / body>
< / html>
此外,脚本代码:
if(isset($ _ POST ['submit']))
{
//确认消息确认
$ confirmation ='
感谢您发送文件和评论
';//成功发送时隐藏
$ hideForm ='style =display:none;';
//电子邮件收件人和转发邮件
$ to ='info@htksa.com';
$ subject ='反馈表';
$ fullname = trim($ _ POST ['fullname']);
$ email = trim($ _ POST ['email']);
$ comments = strip_tags( $ _POST ['comments']);
$ attachment = chunk_split(base64_encode(file_get_contents($ _ FILES ['file'] ['tmp_name'])));
$ filename = $ _FILES ['file'] ['name'];
//建立电子邮件
$ message。=姓名:$ fullname\\\
\ n;
$ message。=电子邮件地址:$ email\\\
\ n;
$ message。=评论:$ comments \ n \ n ;
$ boundary = md5(日期('r',时间()));
$ headers =来自:your@domain.com \\\
Reply-To:your@emailaddress.com;
$ headers。=\ r\\\
MIME-版本:1.0 \\\\ nConContent-Type:multipart / mixed; boundary = \_1_ $ boundary \;
//构建消息
$ message =名称:$ fullname \\ \\ n \ n;
$ message。=电子邮件地址:$ email\\\
\ n;
$ message。=评论:$ comments \ n \\ n;
$ message =
--_ 1_ $ boundary
内容类型:multipart / alternative; boundary = \_2_ $ boundary \
--_ 2_ $ boundary
内容类型:text / plain; charset = \iso-8859-1 \
内容传输编码:7bit
$ message
--_ 2_ $ boundary -
--_ 1_ $ boundary
Content-Type:application / octet-stream; name = \$ filename \
Content-Transfer-Encoding:base64
内容 - 处理:附件
$附件
--_ 1_ $ boundary--;
邮件($ to,$ subject,$ message,$ headers);
}
?>
<!DOCTYPE HTML>
< html>
< head>
< meta charset =UTF-8>
< title> File Attchment< / title>
< / head>
< body>
< br $>
< form enctype =multipart / form-dataaction =method =发布class =style1>
< label for =tswname>名称< / label>
< input type =textname =fullnameid =tswnamesize =33/>
< label for =tswemail>电子邮件< / label>
< input type =textname =emailid =tswemailsize =33/>
< label for =file>选择要上传的文件: < / label>
< input type =filename =fileid =file>
< label for =comments>评论< / label>
< textarea rows =15cols = 45name =commentsid =tswcomments>< / textarea>
<输入类型=submitname =submitid =submitvalue =send>
< / form>
< / body> ;
< / html>
那么,有什么方法可以解决这个问题吗?
_POST ['submit']))
{
//确认信息
< blockquote> confirmation ='
感谢您发送文件和评论
';//成功发送时隐藏
hideForm ='style =display:none;';
//电子邮件收件人和sublect消息
Hi,
I'm new in HTML & PHP & I hope to get some help with my send your info form.
I created sendyourinfo.html page ,after testing it online ,I can't get all required information in email.
The following is the page code:
<!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 Us - Harmony Of Targets</title>
<link href="oneColLiqCtrHdr.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
background-color: #838383;
}
body,td,th {
font-family: Eras Medium ITC, Georgia, Calibri;
}
.style1 {font-size: small}
.style2 {font-size: medium}
.style3 {font-size: x-large}
-->
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x>}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;> if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)> for(i=0;!x&&d.layers&&i<d.layers.length;i++)> if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body class="oneColLiqCtrHdr" onload="MM_preloadImages('buttons/home2en.jpg','buttons/aboutus2en.jpg','buttons/ourservices2en.jpg','buttons/sendyourinfo2en.jpg','buttons/contactus2en.jpg','buttons/arabic2en.jpg')">
<!-- end #header -->
<img src="logo.jpg" alt="" width="986" height="251" />
If your're looking for new job or want to change your current's, We recommend to provide us your information by filling the below form:
<form action="sendyourinfo-en.php" method="post" enctype="multipart/form-data">
Apply to job Form
| |
Name | <label> <input type="text" name="fullname" id="tswname" size="24" /> </label> |
Gender | <label> <select name="GenderList" id="GenderList"> <option value="choose one">Choose One...</option> <option value="male">Male</option> <option value="female">Female</option> </select> </label> |
Date Of Bith "Years" | <input name="DOB" type="text" id="DOB" size="4" maxlength="4" /> |
Nationality | <input type="text" name="Nationality" id="Nationality" /> |
Current City | <input type="text" name="CurrentCity" id="CurrentCity" /> |
Mobile No. | <input name="MobNo" type="text" id="MobNo" maxlength="20" /> |
<input type="text" id="tswemail" name="email" size="24" /> | |
Experiense "Years" | <input name="ExpYears" type="text" id="ExpYears" size="2" maxlength="2" /> |
Experiense Field | <label> <select name="ExpList" id="ExpList"> <option value="choose one" selected="selected">Choose One...</option> <option value="mngmt-gm">Management - GM</option> <option value="mngmt-others">Management - Others</option> <option value="hr-manager">HR - Manager</option> <option value="hr-admin">HR - Admin</option> </select> </label> |
Upload your CV | <label> <input name="fileupload" type="file" id="fileupload" size="24" /> </label> |
<input type="reset" name="Clear" id="Clear" value="Clear" /> <input name="Submit" type="submit" value="Send" /> |
<label for="tswname">
</label>
</form>
<!-- end #container -->
</body>
</html>
Also, the script code:
if(isset($_POST['submit']))
{
//Confirmation messeage
$confirmation = '
Thanks for sending your file and comments
';//hide from when sent successfully
$hideForm = 'style="display:none;"';
//Email recipient and sublect message
$to = 'info@htksa.com ';
$subject = 'Feedback Form';
$fullname = trim($_POST['fullname']);
$email = trim($_POST['email']);
$comments = strip_tags($_POST['comments']);
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
// build email message
$message .= "Name: $fullname\n\n";
$message .= "Email Address: $email\n\n";
$message .= "Comments: $comments\n\n";
$boundary =md5(date('r', time()));
$headers = "From: your@domain.com\r\nReply-To: your@emailaddress.com";
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
// build message
$message = "Name: $fullname\n\n";
$message .= "Email Address: $email\n\n";
$message .= "Comments: $comments\n\n";
$message="
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
--_2_$boundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>File Attchment</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post" class="style1">
<label for="tswname">Name</label>
<input type="text" name="fullname" id="tswname" size="33" />
<label for="tswemail">Email</label>
<input type="text" name="email" id="tswemail" size="33" />
<label for="file">Select file to upload:</label>
<input type="file" name="file" id="file">
<label for="comments">Comments</label>
<textarea rows="15" cols="45" name="comments" id="tswcomments"></textarea>
<input type="submit" name="submit" id="submit" value="send">
</form>
</body>
</html>
So, Is there any way to fix the problem?
_POST['submit']))
{
//Confirmation messeage
confirmation = 'Thanks for sending your file and comments
';
//hide from when sent successfully
hideForm = 'style="display:none;"';
//Email recipient and sublect message
这篇关于如何创建发送您的信息表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!