Avatar billede salimbharuchi Nybegynder
27. september 2008 - 21:12 Der er 12 kommentarer

Need script to allow users to upload their C.V and get it in emai

hey guys..
I am workin on my webpage..and i need a asp or php script which allows me to gather the users which uploads their c.v on my website..
and get their c.v in email...
form can be in html..
thanks in advance...help is appreciated..
Avatar billede w13 Novice
28. september 2008 - 12:44 #1
Can't you just use a simple formmail? Most webhosts offer a formmail-script to use on your server. Who are your host?
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 11:06 #2
my host is www.azero.dk
it provides formmail script but its a perl script...and i dont want to use that..
heres the html form and php script which am using but dont know wots the problem it doesnt work..
*****************This is my html form************
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<form method="POST" enctype="multipart/form-data" action="upload.php">
  <p><input type="text" name="mail" size="20"></p>
  <p><input type="file" name="upload" size="20" class="formbox"><input type="submit" value="Submit" name="B1"></p>
</form>

</body>

</html>



**************'THIS IS MY PHP SCRIPT************************
<?PHP
error_reporting(7);


if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ClientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ClientIP = $_SERVER['REMOTE_ADDR'];
}

# RegisterGlobals OFF

$FTGmail = $_POST['mail'];
$FTGupload = $_FILES['upload']['name'];


if (get_magic_quotes_gpc) {
$FTGmail = stripslashes($FTGmail);
}
# Redirect user to the error page

if ($validationFailed == true) {

header("Location: error.html");
exit;

}

# Email to Form Owner

$emailTo = '"Salim" <salimbharuchi@gmail.com>';

$emailSubject = "attachment.......from $FTGmail";
$emailSubject = preg_replace('/[\x00-\x1F]/', '', $emailSubject);

$emailFrom = "$FTGmail";
$emailFrom = preg_replace('/[\x00-\x1F]/', '', $emailFrom);

$emailHeader = "From: $emailFrom\n"
. "Reply-To: $emailFrom\n"
. "MIME-Version: 1.0\n"
. "Content-Type: multipart/mixed; boundary=\"FTG_BOUNDRY\"\n"
. "X-Sender: $emailFrom\n"
. "X-Mailer: PHP\n"
. "X-Priority: 3\n"
. "Return-Path: $emailFrom\n"
. "This is a multi-part Content MIME format.\n";

$emailBody = "--FTG_BOUNDRY\n"
. "Content-Type: text/plain; charset=\"ISO-8859-1\"\n"
. "Content-Transfer-Encoding: quoted-printable\n"
. "\n"
. "mail: $FTGmail\n"
. "upload: $FTGupload\n"
. "\n"
. ""
. "\n";

if (file_exists($_FILES['upload']['tmp_name']) === true) {

$fileName = $_FILES['upload']['tmp_name'];
$fileHandle = fopen($fileName, 'r');
$fileAttach = fread($fileHandle, filesize ($fileName));
fclose($fileHandle);

$fileAttach = chunk_split(base64_encode($fileAttach));

$emailBody .= "--FTG_BOUNDRY\n"
. "Content-Type: " . $_FILES['upload']['type'] . "; name=\"" . $_FILES['upload']['name'] . "\"\n"
. "Content-disposition: attachment\n"
. "Content-transfer-encoding: base64\n"
. "\n"
. "$fileAttach\n"
. "\n";

}

$emailBody .= "--FTG_BOUNDRY--\n";

mail($emailTo, $emailSubject, $emailBody, $emailHeader);

# Redirect user to success page

header("Location: success.html");
exit;

# End of PHP script
?>
Avatar billede w13 Novice
29. september 2008 - 11:07 #3
So it does not give you an error message?
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 11:16 #4
it says message sent successfully..i.e success.html message which i wrote...but why dont it sends attached file in email..
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 11:18 #5
and also dude thanxalot for reply...waitin for a working solution frm yur end...
Avatar billede w13 Novice
29. september 2008 - 11:32 #6
So it sends the e-mail, but there is no attachment or..?
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 11:36 #7
no email  with no attachments...
Avatar billede w13 Novice
29. september 2008 - 12:36 #8
Try changing:

$emailTo = '"Salim" <salimbharuchi@gmail.com>';

to:

$emailTo = 'salimbharuchi@gmail.com';

Or perhaps to remove:

header("Location: success.html");

and see, if it writes something.
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 12:55 #9
now i get email with some attachment..but tho in that attachment i cant see any contents...i.e lets say i uploaded a .pdf file...i cant find any contents on that .pdf file..i even uploaded a word file it happend the same...and in the email which i get i can see that attachment file is (zero)0 k size...
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 12:56 #10
can you try sending it to yurself and check whether it works or not?
Avatar billede w13 Novice
29. september 2008 - 13:23 #11
Nope. Sorry. Does not have a PHP server at the moment.
Avatar billede salimbharuchi Nybegynder
29. september 2008 - 13:25 #12
dude...did you get my problem..?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester