I need to add a field that will allow a student to attach thier photo to theonlin application form on our website that will be sent to our email address along with the form data.
Here is the current script that send the email to us:
[php]<?php
//--------------------------Set these paramaters--------------------------
$subject = ‘New Homestay Application’; // Subject of email sent to you.
$emailadd = ‘[email protected]’; // Your email address. This is where the form information will be sent.
$url = ‘http://yourdomain.com/forms/thankyou.html’; // Where to redirect after form is processed.
$req = ‘0’; // Makes all fields required. If set to ‘1’ no field can not be empty. If set to ‘0’ any or all fields can be empty.
// --------------------------Do not edit below this line--------------------------
$text = “Results from Application form:\n\n”;
$space = ’ ';
$line = ’
';
foreach ($_POST as $key => $value)
{
if ($req == ‘1’)
{
if ($value == ‘’)
{echo “$key is empty”;die;}
}
$j = strlen($key);
if ($j >= 20)
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, ‘From: ‘.$emailadd.’’);
echo ‘’;
?>[/php]
We have used this form and script for the past 5 years and it works just fine with no problems at all. However now I need to add a field so the student can send us thier current photo with the form data in a jpg, gif or png format.
Can someone please help me with this problem. I have read so many post on this and just can not wrap my head arround it and I am at a total loss.
Kindest Regards
and many thanks in advance for your professional help.
You can view the working Application form at www.thedewberry.com