Jump to content

check box sending to email showing checked


sandbudd

Recommended Posts

<?php

error_reporting(0);

session_start();

$Domain="http://".$_SERVER['HTTP_HOST'];

 

$fname=$_POST['fname'];

$company=$_POST['company'];

$address=$_POST['address'];

$city=$_POST['city'];

$zip=$_POST['zip'];

$email=$_POST['email'];

$phone=$_POST['phone'];

$fax=$_POST['fax'];

$type2=$_POST['type2'];

$type3=$_POST['type_III'];

$comment=$_POST['comment'];

 

 

$cdir="contactupload";

$save_path="uploads/"; 

 

$date = date("F j, Y, g:i a");

 

$file = $_FILES['userfile'];

 

$k = count($file['name']);

 

for($i=0;$i< $k ;$i++)

{

 

if(isset($save_path) && $save_path!="")

{

$random_digit=rand(0000,9999999);

$name = split('/',$file['name'][$i]);

$name = str_replace("\\","",$name);

$name = str_replace("'","",$name);

$name = str_replace("","_",$name);

$name = str_replace(" ","_",$name);

$name = str_replace(".",$random_digit.".",$name);

 

 

if(move_uploaded_file($file['tmp_name'][$i], $save_path . $name[count($name)-1]))

{

//// download the file/////

$finalfile.="<li><a href='".$Domain."/".$cdir."/download.php?f=".$name[count($name)-1]."'>".$name[count($name)-1]."</a></li>";

$list_files.="<li>".$name[count($name)-1]."</li>";

 

}

}

}

///message in the mail//////

$msg="-- This is the Customer's information --

<br>Full Name: $fname

<br>Company: $company

<br>Address: $address

<br>City: $city

<br>Zip: $zip

<br>Email: <a href='mailto:$email'>$email<a>

<br>Phone Number: $phone

<br>Fax Number: $fax

<br>Process Requested

<br>$type2

<br>$type_III

<br><br>Comments: $comment

<br><br>Attached files:

$finalfile";

 

$msg2="

 

<br>-----------------------------------------------------

<br>

<br>-- Clients information Submitted $date --<br>

<br>Full Name: $fname

<br>Company: $company

<br>Address: $address

<br>City: $city

<br>Zip: $zip

<br>Email Address: <a href='mailto:$email'>$email<a>

<br>Phone Number: $phone

<br>Fax Number: $fax

<br>Process Requested

<br>$type2

<br>$type_III

<br>Comments: $comment

<br><br>Attached files:

<br>$finalfile

<br>";

 

 

///email address////

$to =  "[email protected]";

 

///Subject Title

$subject="New Message";

 

 

//mail Function//////

mail($to,$subject,$msg,"From: $email\n" . "MIME-Version: 1.0\n" .

    "Content-type: text/html; charset=iso-8859-1");

 

$fh = fopen("email.php", "a");

fwrite($fh, $msg2);

fclose($fh);

 

?>

Well I dont know what you mean by "as checked"...

 

I do have two questions though, (1) Why is the code calling to alter a php file, if you just want it to email someone why is it writing to a file? (2) Did you write this script or did someone give it to your or did this come include with some other type of script such as a CMS?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.