<!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=iso-8859-1" />
 
<title>How to export HTML file to MS Word document (.doc) using php code</title>
 
<style>
 
h1 {
 
height: 50px;
 
width: 100%;
 
font-size: 18px;
 
background: #18aa8d;
 
color: white;
 
line-height: 150%;
 
border-radius: 3px 3px 0 0;
 
box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.2);
 
}
 
form {
 
box-sizing: border-box;
 
width: 500px;
 
margin: 100px auto 0;
 
box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.2);
 
padding-bottom: 40px;
 
border-radius: 3px;
 
}
 
form h1 {
 
box-sizing: border-box;
 
padding: 20px;
 
}
 
.text-field {
 
margin: 40px 25px;
 
width: 80%;
 
display: block;
 
border: none;
 
padding: 10px 0;
 
-webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
 
transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
 
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
 
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
 
background-position: -100% 0;
 
background-size: 100% 100%;
 
background-repeat: no-repeat;
 
color: #0e6252;
 
}
 
.text-field:focus, .text-field:valid {
 
box-shadow: none;
 
outline: none;
 
background-position: 0 0;
 
border-bottom: solid 1px #1abc9c;
 
}
 
button {
 
float:right;
 
border: none;
 
background: #1abc9c;
 
cursor: pointer;
 
border-radius: 3px;
 
padding: 6px;
 
width: 40px;
 
color: white;
 
margin-right: 40px;
 
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.2);
 
}
 
button:hover {
 
-webkit-transform: translateY(-3px);
 
-ms-transform: translateY(-3px);
 
transform: translateY(-3px);
 
box-shadow: 0 6px 6px 0 rgba(0, 0, 0, 0.2);
 
} 
.text-field-1 {
 
background:none;
 
}
 
</style>
 
</head>
 
<body>
 
<form method="POST" action="toword.php">
 
<h1>Form</h1>
 
<input placeholder="Heading" name="heading" class="text-field" type="text" required="">
 
<textarea rows="3" cols="6"  name="content" placeholder="content"  class="text-field text-field-1"></textarea>
 
<button type="submit" name="exportToWord">Export Doc</button> &nbsp;&nbsp;&nbsp;
 
</form>
 
</body>
 
</html>