logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-14-2012, 04:30 PM   #1
hussam81
 
Join Date: Nov 2012
Posts: 29
Default send job form to email directly

I found this script for send form data to email address with attachment: which value must be replaced to make this script work fine
the idea of my form is when preesed submit then the data send to email like :cv@site.com
with file attachment as a c.v
and user see "thanks your data has been sent"
PHP Code:
<?php
// get posted data into local variables
$EmailTo "[EMAIL="email@site.com"]email@site.com[/EMAIL]";
$Subject "A new file was uploaded!";
$email Trim(stripslashes($_POST['email']));
$comments Trim(stripslashes($_POST['comments']));
$name=$_POST['name'];
 
$mobile=$_POST['mobile'];
 
$email=$_POST['email'];
 
$date=$_POST['date'];
 
$country=$_POST['country'];
 
$city=$_POST['city'];
 
$RadioGroup3=$_POST['RadioGroup3'];
 
$file=file_get_contents($_FILES['file']['name']);
 
$typeofjob=$_POST['RadioGroup1'];
// prepare email body text
$Body .= "الاسم: ";
$Body .= $name;
$Body .= "\n";
$Body .= "الايميل: ";
$Body .= $email;
$Body .= "\n";
$Body .= "الدوله: ";
$Body .= $country;
$Body .= "\n";
$Body .= "المدينه: ";
$Body .= $city;
$Body .= "\n";
$Body .= "الجوال: ";
$Body .= $mobile;
$Body .= "\n";
$Body .= "تاريخ الميلاد: ";
$Body .= $date;
$Body .= "\n";
$Body .= "الوظيفه: ";
$Body .= $RadioGroup3;
$Body .= "\n";
// ==============
// Configuration
// ==============
$uploaddir "c:\upldr/";
// Where you want the files to upload to
//Important: Make sure this folders permissions is 0777!
$allowed_ext "jpg, JPG, jpeg, gif, docx,doc,txt, pdf";
// These are the allowed extensions of the files that are uploaded
$max_size "10485760";
// 50000 is the same as 50kb
$max_height "6000";
// This is in pixels - Leave this field empty if you don't want to upload images
$max_width "6000";
// This is in pixels - Leave this field empty if you don't want to upload images
// Check Entension
$extension pathinfo($_FILES['file']['name']);
$extension $extension[extension];
$allowed_paths explode(", "$allowed_ext);
for(
$i 0$i count($allowed_paths); $i++) {
if (
$allowed_paths[$i] == "$extension") {
$ok "1";
}
}
// Check File Size
if ($ok == "1") {
if(
$_FILES['file']['size'] > $max_size)
{
print 
"<meta http-equiv=\"refresh\" content=\"0;URL=../upload_ERROR_SIZE\">";
exit;
}
see the attachment
Attached Images
File Type: png photo.png (19.3 KB, 2 views)

Last edited by gentleone; 11-14-2012 at 05:20 PM.. Reason: wrapped in PHP tags
hussam81 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:11 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com