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')">
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">
|
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" /> |
Email | <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?