PHP, HTML & Word
- D1N0
- Newbie


- Joined: Sep 26, 2008
- Posts: 5
- Status: Offline
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
Thanks, yell at me for not having code, i know, working as fast as i can on it.
Thanks
Dino
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
September 29th, 2008, 9:52 am
- D1N0
- Newbie


- Joined: Sep 26, 2008
- Posts: 5
- Status: Offline
OK here is the HTML
<!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" /> </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> </p>
</body>
</html>
<!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" /> </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> </p>
</body>
</html>
- <!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" /> </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> </p>
- </body>
- </html>
- D1N0
- Newbie


- Joined: Sep 26, 2008
- Posts: 5
- Status: Offline
And Here is the PHP
<?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" /> </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   Please confirm the issue in the active directory at the user's site.<br />
$cbox2   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>";
<?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" /> </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   Please confirm the issue in the active directory at the user's site.<br />
$cbox2   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>";
- <?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" /> </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   Please confirm the issue in the active directory at the user's site.<br />
- $cbox2   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>";
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 3 posts
- Users browsing this forum: No registered users and 143 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

