Hi Max,
I've added more information to better help you or others to understand my situation. I have also verified the links u supplied and I could find what I really wanted to do. So here goes :-)
I am trying to create a grading sheet. Well, I've done it, it calculates and post my necesary information.
My problem is, I currently have setup to prompt the user to save or open the Excel .Xls file that it generates. However, I've been trying to search all over the place for my result, to send an email to a specific recipient with attached to output that it creates in Xls instead of saving the file.
In other words:
- fill out the form
- click submit
- then it sends email with the .xls file without prompting the user to save it or without storing it on the server(if possible)
I've been suggested to use phpmail which I don't think will do the trick as I am not taking a file from the HD just the post data that's been converted to xls and send via email as attachment. If there is a way though with phpmail, can someone guide me on how to setup this particular feature.
if you want to see what it's currently doing, please visit http://moloch.ca/php/testing/form.html
Also, this is my code for the PHP file ( result.php ) if it may help:
Thanks for your help.
Brian
<?php
$agent = $_POST['agent'];
$salutation = $_POST['salutation'];
$transition = $_POST['transition'];
$loyalty = $_POST['loyalty'];
$solving = $_POST['solving'];
$rapport = $_POST['rapport'];
$footer = $_POST['footer'];
$resolution = $_POST['resolution'];
$userid = $_POST['userid'];
$lob = $_POST['lob'];
$internal = $_POST['internal'];
$procedures = $_POST['procedures'];
$spelling = $_POST['spelling'];
$grammar = $_POST['grammar'];
$punctuation = $_POST['punctuation'];
$msgcopier = $_POST['msgcopier'];
$bonus = $_POST['bonus'];
$today = date('d-M-y');
$notesq1 = $_POST['notesq1'];
$notesq2 = $_POST['notesq2'];
$notesq3 = $_POST['notesq3'];
$notesq4 = $_POST['notesq4'];
$notesq5 = $_POST['notesq5'];
$notesq6 = $_POST['notesq6'];
$notesq7 = $_POST['notesq7'];
$notesq8 = $_POST['notesq8'];
$notesq9 = $_POST['notesq9'];
$notesq10 = $_POST['notesq10'];
$notesq11 = $_POST['notesq11'];
$notesq12 = $_POST['notesq12'];
$total = $salutation + $transition + $loyalty + $solving + $rapport + $footer + $resolution + $internal + $procedures + $spelling + $grammar + $punctuation + $bonus ;
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: filename=$agent-$userid.xls");
?>
<html>
<head><title>Grading Sheet Result</title>
</head>
<body>
<body>
<center>
<table border=1 width=1000>
<tr><td align=center bgcolor=blue colspan="4"><b><font color=yellow>CONTACT ASSESSMENT GRADING SHEET RESULTS</font></b>
</td></tr>
<tr><td width=230><b>Name: </b></td><td width=150><?php echo $agent; ?></td>
<td width=120>
<b>Case</b>
</td>
<td><?php echo $userid; ?></td>
</td>
</tr>
<tr><td> Graded on </td><td><?php echo $today; ?></td>
<td>
<b>Business</b>
</td>
<td><?php echo $lob; ?></td>
</td>
</tr>
<tr height="50"><td align=top><b> Salutation (header): </b></td><td><b><center> <?php echo $salutation; ?></center></b></td>
<td colspan="2" align="top"> <div STYLE=" height: 50px; width:600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq1; ?></div>
</td>
</tr>
<tr height="50"><td><b> Transition: </b></td><td><b><center><?php echo $transition; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq2; ?></div>
</td>
</tr>
<tr height="50"><td><b> Loyalty close (footer): </b></td><td><b><center><?php echo $footer; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq3; ?></div>
</td>
</tr>
<tr height="50"><td><b> Delivery: </b></td><td><b><center><?php echo $delivery; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq4; ?></div>
</td>
</tr>
<tr height="50"><td><b> Rapport Building: </b></td><td><b><center><?php echo $rapport; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq5; ?></div>
</td>
</tr>
<tr height="50"><td><b> Problem solving: </b></td><td><b><center><?php echo $solving; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq6; ?></div>
</td>
</tr>
<tr height="50"><td><b> One contact Resolution: </b></td><td><b><center><?php echo $resolution; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq7; ?></div>
</td>
</tr>
<tr height="50"><td><b> Internal policies and procedures: </b></td><td><b><center><?php echo $procedures; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq8; ?></div>
</td>
</tr>
<tr height="50"><td><b> Revenue (bonus points): </b></td><td><b><center><?php echo $bonus; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq9; ?></div>
</td>
</tr>
<tr height="50">
<td> <b>Spelling errors: </b></td><td><b><center><?php echo $spelling; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq10; ?></div>
</td>
</tr>
<tr height="50">
<td> <b>Grammar: </b></td><td><b><center><?php echo $grammar; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq11; ?></div>
</td>
</tr>
<tr height="50"><td><b> Punctuation: </b></td><td><b><center><?php echo $punctuation; ?></center></b></td>
<td colspan="2"> <div STYLE=" height: 50px; width: 600px; overflow: auto;">
<b>Notes:</b> <?php echo $notesq12; ?></div>
</td>
</tr>
<tr><td><b>Total: </b></td><td><b><center><font color="blue"><?php echo $total; ?></font> / 100</center></b></td>
</tr>
<tr>
<td colspan="4" witdh="1000">
<b>Copy of message:</b> <?php echo $msgcopier; ?>
</td>
</tr>
</table>
</body></html>
<?php ?>