PHP, HTML & Word

  • D1N0
  • Newbie
  • Newbie
  • D1N0
  • Posts: 5

Post 3+ Months Ago

I have read the threads on creating a word document. Worked wonders, for the most part. I like the headers method. Here is the problem. I have a page, you fill out the form and click save. When save is clicked, i want php to create an exact duplicate of the page. Including the image and formating. I understand that word is not going to know where my css is but thats ok. I can live with that and natively code the formatting. I get all kinds of errors when i try to insert an image. I have tried double quoting the path and all the fields for it. I realize that i should post some code here, and am working on version that i can post, as the original is kinda confidential information. Look forward to hearing from all of you. On a side note, how do i get the script to execute the save to word doc, and then execute more php. All it does is put it in the word document.

Thanks, yell at me for not having code, i know, working as fast as i can on it.

Thanks
Dino
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • D1N0
  • Newbie
  • Newbie
  • D1N0
  • Posts: 5

Post 3+ Months Ago

OK here is the HTML
Code: [ Select ]
 
<!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>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
    color: #FF0000;
    font-weight: bold;
}
-->
</style>
</head>
 
<body>
<p><img width="627" height="88" src="testimage.jpg" alt="testimage.jpg" />&nbsp;</p>
 <form name="autogroup" method="POST" action="autogroup.php">
<p>Autogroup Troubleshooting <br />
 
<p class="style1">SME approval is required prior to escalation. </p>
<p>Please complete the following form for Autogroup  Troubleshooting escalations:<br />
  <br />
Basic troubleshooting required from HD: <br />
  <input type="checkbox" name="Verified1" value="1" id="verify1"/>
Please  confirm the issue in the active directory at the user's site.
  <br />
  <input type="checkbox" name="Verified2" value="1" id="verify2"/>
Please verify that this  distribution list is managed by <a href="http:linkgoeshere" target="_blank">link<br />
  </a><br />
  Service Request Number:<br />
  <input type="text" maxlength="66" size="64" name="sr" />
  <br />
  What is the user's alias  and domain?<br />
  <input type="text" maxlength="66" size="66" name="alias" />
  <br />
  What is the alias of the  DG that is experiencing issues? <br />
  <input type="text" maxlength="66" size="66" name="dl" />
  <br />
  Please list (to the best  of your knowledge) who on the DG is being affected: <br />
  <input type="text" maxlength="66" size="66" name="audience" />
  <br />
  What does the history of  the DG read in tool: <br />
  <input type="text" maxlength="66" size="66" name="dlhistory" />
  <br />
  What is the issue the user  is experiencing?
  <br />
  <textarea name="issue" cols="63" rows="5"></textarea>
</p>
<input type="submit" name="Submit" value="Save" />
</form>
 
<p>&nbsp;</p>
</body>
</html>
 
 
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <title>Untitled Document</title>
  7. <style type="text/css">
  8. <!--
  9. .style1 {
  10.     color: #FF0000;
  11.     font-weight: bold;
  12. }
  13. -->
  14. </style>
  15. </head>
  16.  
  17. <body>
  18. <p><img width="627" height="88" src="testimage.jpg" alt="testimage.jpg" />&nbsp;</p>
  19.  <form name="autogroup" method="POST" action="autogroup.php">
  20. <p>Autogroup Troubleshooting <br />
  21.  
  22. <p class="style1">SME approval is required prior to escalation. </p>
  23. <p>Please complete the following form for Autogroup  Troubleshooting escalations:<br />
  24.   <br />
  25. Basic troubleshooting required from HD: <br />
  26.   <input type="checkbox" name="Verified1" value="1" id="verify1"/>
  27. Please  confirm the issue in the active directory at the user's site.
  28.   <br />
  29.   <input type="checkbox" name="Verified2" value="1" id="verify2"/>
  30. Please verify that this  distribution list is managed by <a href="http:linkgoeshere" target="_blank">link<br />
  31.   </a><br />
  32.   Service Request Number:<br />
  33.   <input type="text" maxlength="66" size="64" name="sr" />
  34.   <br />
  35.   What is the user's alias  and domain?<br />
  36.   <input type="text" maxlength="66" size="66" name="alias" />
  37.   <br />
  38.   What is the alias of the  DG that is experiencing issues? <br />
  39.   <input type="text" maxlength="66" size="66" name="dl" />
  40.   <br />
  41.   Please list (to the best  of your knowledge) who on the DG is being affected: <br />
  42.   <input type="text" maxlength="66" size="66" name="audience" />
  43.   <br />
  44.   What does the history of  the DG read in tool: <br />
  45.   <input type="text" maxlength="66" size="66" name="dlhistory" />
  46.   <br />
  47.   What is the issue the user  is experiencing?
  48.   <br />
  49.   <textarea name="issue" cols="63" rows="5"></textarea>
  50. </p>
  51. <input type="submit" name="Submit" value="Save" />
  52. </form>
  53.  
  54. <p>&nbsp;</p>
  55. </body>
  56. </html>
  57.  
  58.  
  • D1N0
  • Newbie
  • Newbie
  • D1N0
  • Posts: 5

Post 3+ Months Ago

And Here is the PHP
Code: [ Select ]
 
<?php
//-----This Sections is all of the data for the request email----
 
//Get Data from the Form
 
$cbox1 = $_POST['verify1'];
$cbox2 = $_POST['verify2'];
$sr = $_POST['sr'];
$user = $_POST['alias'];
$group = $_POST['dl'];
$audience = $_POST['audience'];
$history = $_POST['dlhistory'];
$issue = $_POST['issue'];
$filename = sprintf("%12s.doc",$sr);
 
 
header("Content-Type: application/vnd.ms-word");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=$filename");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>";
 
 
echo "<p><img width="627" height="88" src="testimage.jpg" alt="testimage.jpg" />&nbsp;</p>
 <form name="autogroup" method="POST" action="autogroup.php">
<p>Autogroup Troubleshooting <br />
 
<p class="style1">SME approval is required prior to escalation. </p>
<p>Please complete the following form for Autogroup  Troubleshooting escalations:<br />
  <br />
Basic troubleshooting required from HD: <br />
$cbox1 &nbsp Please  confirm the issue in the active directory at the user's site.<br />
$cbox2 &nbsp Please verify that this  distribution list is managed by <a href="http:linkgoeshere" target="_blank">link</a><br />
<br />
  Service Request Number:<br />
  $sr <br />
  What is the user's alias  and domain?<br />
  $user <br />
  What is the alias of the  DG that is experiencing issues? <br />
  $dl <br />
  Please list (to the best  of your knowledge) who on the DG is being affected: <br />
  $audience <br />
  What does the history of  the DG read in tool: <br />
  $dlhistory  <br />
  What is the issue the user  is experiencing?  <br />
  $issue
</p>
";
echo "</body>";
echo "</html>";
 
 
 
 
 
  1.  
  2. <?php
  3. //-----This Sections is all of the data for the request email----
  4.  
  5. //Get Data from the Form
  6.  
  7. $cbox1 = $_POST['verify1'];
  8. $cbox2 = $_POST['verify2'];
  9. $sr = $_POST['sr'];
  10. $user = $_POST['alias'];
  11. $group = $_POST['dl'];
  12. $audience = $_POST['audience'];
  13. $history = $_POST['dlhistory'];
  14. $issue = $_POST['issue'];
  15. $filename = sprintf("%12s.doc",$sr);
  16.  
  17.  
  18. header("Content-Type: application/vnd.ms-word");
  19. header("Expires: 0");
  20. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  21. header("content-disposition: attachment;filename=$filename");
  22. echo "<html>";
  23. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
  24. echo "<body>";
  25.  
  26.  
  27. echo "<p><img width="627" height="88" src="testimage.jpg" alt="testimage.jpg" />&nbsp;</p>
  28.  <form name="autogroup" method="POST" action="autogroup.php">
  29. <p>Autogroup Troubleshooting <br />
  30.  
  31. <p class="style1">SME approval is required prior to escalation. </p>
  32. <p>Please complete the following form for Autogroup  Troubleshooting escalations:<br />
  33.   <br />
  34. Basic troubleshooting required from HD: <br />
  35. $cbox1 &nbsp Please  confirm the issue in the active directory at the user's site.<br />
  36. $cbox2 &nbsp Please verify that this  distribution list is managed by <a href="http:linkgoeshere" target="_blank">link</a><br />
  37. <br />
  38.   Service Request Number:<br />
  39.   $sr <br />
  40.   What is the user's alias  and domain?<br />
  41.   $user <br />
  42.   What is the alias of the  DG that is experiencing issues? <br />
  43.   $dl <br />
  44.   Please list (to the best  of your knowledge) who on the DG is being affected: <br />
  45.   $audience <br />
  46.   What does the history of  the DG read in tool: <br />
  47.   $dlhistory  <br />
  48.   What is the issue the user  is experiencing?  <br />
  49.   $issue
  50. </p>
  51. ";
  52. echo "</body>";
  53. echo "</html>";
  54.  
  55.  
  56.  
  57.  
  58.  

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 69 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.