matt00
11-27-2006, 10:30 PM
I have made a form and found a script that is supposed to send the attachments and results from the form to me but it is not sending me the results of the form only the attachment can someone see any errors in the script? or do i have to add something to make it send the results too?
<table width="55%" height="555" border="0" align="center">
<tr>
<td height="137" colspan="4"> <div align="center"><img src="files/topbar1.gif" name="image1" width="795" height="133" border="0" align="absmiddle" usemap="#Map" id="image1"></div></td>
</tr>
<tr>
<td width="24%" height="153"> </td>
<td height="75" colspan="2" class="text">
<form action="?php echo $PHP_SELF;?" method="post" enctype="multipart/form-data" name="form1">
<p>
<?php
include "MIME.class";
define('TO', 'btstudio@internode.on.net'); # CHANGE THIS TO A REAL ADDRESS (yours?)
// Has there been a form submission? If yes, go on and
// process...
if (is_array($HTTP_POST_VARS)) {
if ($resume != 'none') {
$fname = './'.$resume_name; // make a real filename
// Get the content-type of the uploaded file
if (preg_match("!/x\-.+!i", $resume_type))
$type = OCTET;
else
$type = $resume_type;
$from = sprintf("'%s' <%s>", $name, $email) ;
copy($resume, $fname); //do error checking if need
$mime = new MIME_mail($from, TO, 'online application form', "Please find bolow the results of the online application form", "Cc: $email");
$mime->fattach($fname, "Resume of $name", $type);
$mime->send_mail();
echo "Dear $name<p>Your resume has been emailed and a copy sent to you<br>";
unlink($resume); // remove the uploaded file
} else {
echo "Dear $name<p>You have not submitted your resume. Please use the browse button to attach it and click send!<br>";
}
}
?>
</p>
<p> </p>
<table width="94%">
<tr>
<td class="text">Surname</td>
<td height="38" class="text"> <p>
<input name="Surname2" size="15" type="text">
</p></td>
<td class="text">Given</td>
<td height="38" class="text"> <input name="name" type="text" id="name" size="15"></td>
</tr>
<tr>
<td class="text">D.O.B.</td>
<td height="40" class="text"> <input name="DOB2" type="text" id="DOB4" size="15"></td>
<td height="40" class="text">Sex</td>
<td height="40" class="text"> <select size="1" name="select">
<option selected="selected">Male</option>
<option>Female</option>
</select></td>
</tr>
<tr>
<td class="text">Address</td>
<td height="40" class="text"> <input name="address2" size="25" type="text"></td>
<td height="40" class="text">Suburb</td>
<td height="40" class="text"> <input name="Suburb2" type="text" id="Suburb3" size="15"></td>
</tr>
<tr>
<td class="text">Postcode</td>
<td height="35" class="text"> <input name="pc2" type="text" id="pc" size="15"></td>
<td height="35" class="text">State</td>
<td height="35" class="text"> <select size="1" name="select">
<option selected>SA</option>
<option>NT</option>
<option>NSW</option>
<option>QLD</option>
<option>TAS</option>
<option>VIC</option>
<option>WA</option>
</select></td>
</tr>
<tr>
<td class="text">Country </td>
<td height="37" class="text"> <input name="Country2" size="15" value="Australia" type="text"></td>
<td height="37" class="text">Resident </td>
<td height="37" class="text"> <select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Phone(H) </td>
<td height="35" class="text"> <p>
<input name="Phoneh2" size="15" type="text">
</p></td>
<td height="35" class="text">Phone(M)</td>
<td height="35" class="text"> <input name="Phonem2" size="15" type="text"></td>
</tr>
<tr>
<td class="text"><p>Nationality </p></td>
<td height="34" class="text"> <input name="nationality" type="text" id="nationality" size="15"></td>
<td height="34" class="text">Tax File #</td>
<td height="34" class="text"> <input name="tfn2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Height</td>
<td height="-2" class="text"><input name="height2" size="5" type="text">
cm </td>
<td height="-2" class="text">Police record</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa Required</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
<td height="-2" class="text">Transport</td>
<td height="-2" class="text"><select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa #</td>
<td height="-2" class="text"><input name="visanum2" size="15" type="text"></td>
<td height="-2" class="text">Exp. Date</td>
<td height="-2" class="text"><input name="visaexpire2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Job Seeker ID</td>
<td height="-2" class="text"><input name="jsid2" size="15" type="text"></td>
<td height="-2" class="text">Position Type</td>
<td height="-2" class="text"><input name="position2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Email</td>
<td height="36" colspan="3" class="text"> <input name="email" type="text" id="email" size="35"></td>
</tr>
<tr>
<td class="text"> <div align="left">
<p>Resume (C.V.)</p>
</div></td>
<td height="34" colspan="3" class="text"><b><font color="#993300" size="2">
<input name="resume" type="file" id="resume" >
</font></b></td>
</tr>
<tr>
<td class="text"><p>Comments</p>
<p> </p>
<p> </p></td>
<td height="-2" colspan="3" class="text"><b><font color="#993300" size="2">
<textarea rows="4" name="textarea" cols="40"></textarea>
</font></b></td>
</tr>
<tr>
<td class="text"> </td>
<td height="30" colspan="3" class="text"> <div align="right">
<input name="Submit2" type="submit" value="Submit">
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
<p> </p>
</form>
<p align="center"><br>
</p>
</td>
<td width="23%" height="75"><p align="center" class="text"> </p></td>
</tr>
<tr>
<td height="24" colspan="4"><div align="center"><font color="#999999" size="-7" face="Century Gothic">copyright
montica 2006</font></div></td>
</tr>
</table>
<table width="55%" height="555" border="0" align="center">
<tr>
<td height="137" colspan="4"> <div align="center"><img src="files/topbar1.gif" name="image1" width="795" height="133" border="0" align="absmiddle" usemap="#Map" id="image1"></div></td>
</tr>
<tr>
<td width="24%" height="153"> </td>
<td height="75" colspan="2" class="text">
<form action="?php echo $PHP_SELF;?" method="post" enctype="multipart/form-data" name="form1">
<p>
<?php
include "MIME.class";
define('TO', 'btstudio@internode.on.net'); # CHANGE THIS TO A REAL ADDRESS (yours?)
// Has there been a form submission? If yes, go on and
// process...
if (is_array($HTTP_POST_VARS)) {
if ($resume != 'none') {
$fname = './'.$resume_name; // make a real filename
// Get the content-type of the uploaded file
if (preg_match("!/x\-.+!i", $resume_type))
$type = OCTET;
else
$type = $resume_type;
$from = sprintf("'%s' <%s>", $name, $email) ;
copy($resume, $fname); //do error checking if need
$mime = new MIME_mail($from, TO, 'online application form', "Please find bolow the results of the online application form", "Cc: $email");
$mime->fattach($fname, "Resume of $name", $type);
$mime->send_mail();
echo "Dear $name<p>Your resume has been emailed and a copy sent to you<br>";
unlink($resume); // remove the uploaded file
} else {
echo "Dear $name<p>You have not submitted your resume. Please use the browse button to attach it and click send!<br>";
}
}
?>
</p>
<p> </p>
<table width="94%">
<tr>
<td class="text">Surname</td>
<td height="38" class="text"> <p>
<input name="Surname2" size="15" type="text">
</p></td>
<td class="text">Given</td>
<td height="38" class="text"> <input name="name" type="text" id="name" size="15"></td>
</tr>
<tr>
<td class="text">D.O.B.</td>
<td height="40" class="text"> <input name="DOB2" type="text" id="DOB4" size="15"></td>
<td height="40" class="text">Sex</td>
<td height="40" class="text"> <select size="1" name="select">
<option selected="selected">Male</option>
<option>Female</option>
</select></td>
</tr>
<tr>
<td class="text">Address</td>
<td height="40" class="text"> <input name="address2" size="25" type="text"></td>
<td height="40" class="text">Suburb</td>
<td height="40" class="text"> <input name="Suburb2" type="text" id="Suburb3" size="15"></td>
</tr>
<tr>
<td class="text">Postcode</td>
<td height="35" class="text"> <input name="pc2" type="text" id="pc" size="15"></td>
<td height="35" class="text">State</td>
<td height="35" class="text"> <select size="1" name="select">
<option selected>SA</option>
<option>NT</option>
<option>NSW</option>
<option>QLD</option>
<option>TAS</option>
<option>VIC</option>
<option>WA</option>
</select></td>
</tr>
<tr>
<td class="text">Country </td>
<td height="37" class="text"> <input name="Country2" size="15" value="Australia" type="text"></td>
<td height="37" class="text">Resident </td>
<td height="37" class="text"> <select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Phone(H) </td>
<td height="35" class="text"> <p>
<input name="Phoneh2" size="15" type="text">
</p></td>
<td height="35" class="text">Phone(M)</td>
<td height="35" class="text"> <input name="Phonem2" size="15" type="text"></td>
</tr>
<tr>
<td class="text"><p>Nationality </p></td>
<td height="34" class="text"> <input name="nationality" type="text" id="nationality" size="15"></td>
<td height="34" class="text">Tax File #</td>
<td height="34" class="text"> <input name="tfn2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Height</td>
<td height="-2" class="text"><input name="height2" size="5" type="text">
cm </td>
<td height="-2" class="text">Police record</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa Required</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
<td height="-2" class="text">Transport</td>
<td height="-2" class="text"><select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa #</td>
<td height="-2" class="text"><input name="visanum2" size="15" type="text"></td>
<td height="-2" class="text">Exp. Date</td>
<td height="-2" class="text"><input name="visaexpire2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Job Seeker ID</td>
<td height="-2" class="text"><input name="jsid2" size="15" type="text"></td>
<td height="-2" class="text">Position Type</td>
<td height="-2" class="text"><input name="position2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Email</td>
<td height="36" colspan="3" class="text"> <input name="email" type="text" id="email" size="35"></td>
</tr>
<tr>
<td class="text"> <div align="left">
<p>Resume (C.V.)</p>
</div></td>
<td height="34" colspan="3" class="text"><b><font color="#993300" size="2">
<input name="resume" type="file" id="resume" >
</font></b></td>
</tr>
<tr>
<td class="text"><p>Comments</p>
<p> </p>
<p> </p></td>
<td height="-2" colspan="3" class="text"><b><font color="#993300" size="2">
<textarea rows="4" name="textarea" cols="40"></textarea>
</font></b></td>
</tr>
<tr>
<td class="text"> </td>
<td height="30" colspan="3" class="text"> <div align="right">
<input name="Submit2" type="submit" value="Submit">
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
<p> </p>
</form>
<p align="center"><br>
</p>
</td>
<td width="23%" height="75"><p align="center" class="text"> </p></td>
</tr>
<tr>
<td height="24" colspan="4"><div align="center"><font color="#999999" size="-7" face="Century Gothic">copyright
montica 2006</font></div></td>
</tr>
</table>