Forum Moderators: coopster

Message Too Old, No Replies

PHP- File upload/handling script to upload resume

How is this done?

         

mmockus66

12:55 am on Jun 12, 2009 (gmt 0)

10+ Year Member



I created a website with an employment application but would like to include the option to upload resume. How is this done? I also need to figure out how to take the data keyed into the employment application and send it to an email account in the same format as it appears on the web link below. Right now when it post to the email account receiving this data it is not in a nice format.

[edited by: encyclo at 1:26 am (utc) on June 12, 2009]
[edit reason] no links to personal sites please [/edit]

rocknbil

4:46 am on Jun 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard mmockus66.

Handling file uploads, PHP.net [us2.php.net]

Right now when it post to the email account receiving this data it is not in a nice format.

You need to generate HTML emails. Basically you compose an HTML page.

Then when sending the mail, you need to include the content-type:text/html header.

$email_subj="Thank You For Your Order";

$text ="
<html></head><title>Test email</title></head>
<body>
<p>Dear $fname,</p>
<p>Here is your order.<p>
<table width="65%" align="center">
<tr><td>Name:</td><td>$fname $lname</td></tr>
<tr><td Total:</td><td>\$$total</td></tr>
</table>
";

$headers = "From: $from\r\n"; // Preformat as "company" <email>
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $email_subj, $text, $headers);

You most likely will want to attach the uploaded file to the email - PHP mail [us.php.net]

Email with attachments and special types of content (e.g. HTML) can be sent using this function. This is accomplished via MIME-encoding - for more information, see this » Zend article [zend.com] or the » PEAR Mime Classes [pear.php.net].