Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="proposal_form" action="<?php echo htmlspecialchars(stripslashes(trim($_SERVER['PHP_SELF']))); ?>" method="post">
- <input type="submit" name="submit_docs" value="Export as MS Word" class="input-button" />
- </form>
- <?php
- if(isset($_POST['submit_docs'])){
- header("Content-Type: application/vnd.msword");
- header("Expires: 0");//no-cache
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");//no-cache
- header("content-disposition: attachment;filename=sampleword.doc");
- }
- echo "<html>";
- echo " <h1>PHP - Export Content to MS Word document</h1>
- <p>This is a test.<p>";
- echo "</html>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement