Sendmail.php file not working properly - no errors thrown

Hi all,

I am lees than new to php and wrote 2 seperate php files for a form on my website. One file was a general sendmail.php which formatted the form inputs into a legible email. The second was a file_upload.php file that uploaded a single file to a target directory on my server and renamed the file to CLIENT_PROJECT_FILENAME_INCREMENT.EXTENSION so no dupe files would exist. When tested the two forms worked individually. However when I combined them into a single sendmail.php file, the rename and upload_file functions do not work at all. No errors are being displayed. The Form simply emails me the correctly formatted answers to my form questions, but does not upload the attached file and thus does not rename said file as planned.

A link to a simplified form is here:

File Upload Form

The underlying sendmail.php form is here:

 <?php
$project = $_REQUEST['project'] ; 
$project_other = $_REQUEST['project_other'] ; 
$quantity = $_REQUEST['quantity'] ;     
$pages = $_REQUEST['pages'] ; 
$color = $_REQUEST['color'] ; 
$color_other = $_REQUEST['color_other'] ; 
$size = $_REQUEST['size'] ; 
$page_layout = $_REQUEST['page_layout'] ; 
$stock = $_REQUEST['stock'] ; 
$stock_other = $_REQUEST['stock_other'] ; 
$paper_finish = $_REQUEST['paper_finish'] ; 
$paper_finish_other = $_REQUEST['paper_finish_other'] ; 
$typeset = $_REQUEST['typeset'] ; 
$timeframe = $_REQUEST['timeframe'] ; 
$budget = $_REQUEST['budget'] ; 
$add_info = $_REQUEST['add_info'] ; 
$name = $_REQUEST['name'] ; 
$phone = $_REQUEST['phone'] ; 
$email = $_REQUEST['email'] ; 
$company = $_REQUEST['company'] ; 
$proj_name = $_REQUEST['proj_name'] ; 
$zip = $_REQUEST['zip'] ; 
$upload = $_REQUEST['upload'] ; 

if (!isset($_REQUEST['email'])) {
    header( "Location: ../pages/quote/quote.html" ); 
}
if ( ereg( "[\\r\
]", $name ) || ereg( "[\\r\
]", $email ) ) {
    header( "Location: ../pages/quote/quote_injection_error.html" ); 
}
elseif (empty($name) || empty($phone) || empty($email) || empty($company) || empty($proj_name) || empty($zip) || empty($project) || empty($quantity) || empty($color) || empty($size) || empty($timeframe) || empty($budget)) {
    header( "Location: ../pages/quote/quote_content_error.html" ); 
}
else {
    mail( "QUOTES@DOMAIN.com", "Request for Quote: $project", 
        "$add_info\

        What kind of project is this? $project\

        Name: $name\

        Name of Project: $proj_name\

        Company: $company\

        Telephone: $phone\

        E-mail Address: $email\

        ZIP code: $zip\

        Is there a file attachment/upload? $upload\

        What do you need a quote on? $project : $project_other\

        What quantity do you require? $quantity\

        If applicable, how many pages is each document? $pages\

        Full color or black and white? $color : $color_other\

        What size do you want your print project to be? $size\

        What type of page layout do you need for your project? $page_layout\

        What paper stock do you require?  $stock : $stock_other\

        What paper finish do you require? $paper_finish : $paper_finish_other\

        Are your documents typeset? $typeset\

        When do you need this project completed by? $timeframe\
 
        What is your budget for this project? $budget\

        Additional information to help COMPANY prepare our quote for you? $add_info", 
        "From: $name <$email>" ); 
    header( "Location: ../pages/quote/quote_thanks.html" ); 
    }
// Original file_upload.php code follows below
if (isset($_POST['submit'])) {

    // Configuration - Script Options
    $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension
    $file_basename = substr($filename, 0, strripos($filename, '.')); // Get file name minus extension
    $file_ext = substr($filename, strripos($filename, '.')); // Get file extension
    $filesize = $_FILES['file']['size']; // Get file size
    $allowed_file_types = array('.jpg','.jpeg','.gif','.bmp','.png','.pdf','.doc','.docx','.psd'); // These will be the types of files that are allowed to pass the upload validation
    $file_counter = 1; // used to increment filename if name already exists 
    $company = $_REQUEST['company']; 
    $project = $_REQUEST['proj_name'];

    // File renaming and upload functionality
    if (in_array($file_ext,$allowed_file_types) && ($filesize < 10000001)) { // Checks to make sure uploaded file(s) is an allowed file type AND within the allowable file size (currently 10MB)

        // Rename File
        $newfilename = $company . '_' . $proj_name . '_' . $file_basename; // Rename file as (CompanyName_FileName_DateStamp)
        // Loop until an available file name is found
        while (file_exists( "file_uploads/" . $newfilename ))
            $finalfilename = $newfilename . '_' . $file_counter++ . $file_ext; // This will be the File Name shown in the upload destination directory (currently the "file_uploads" directory)
        if (file_exists("file_uploads/" . $finalfilename)) {
            // file already exists error
            echo "This file already exists. Please rename this file and upload again if necessary."; 
        } else {
            move_uploaded_file($_FILES["file"]["tmp_name"], "file_uploads/" . $finalfilename); 
            echo "File uploaded successfully."; 
        } 
    }   elseif (empty($file_basename)) {
            // file selection error
            echo "Please select a file to upload."; 
        } elseif ($filesize > 10000000) {
            //file size error
            echo "The file you are trying to upload is too large. Files must be no larger than 10MB."; 
        } else {
            // file type error
            echo "The file you attempted to upload is not allowed. You can only upload the following types of files: .jpg, .jpeg, .gif, .bmp, .png, .pdf, .doc, .docx, and .psd."; 
            unlink($_FILES["file"]["tmp_name"]); 
        }
    }
    /* 
    must add page links for error and success messages: 
    // redirect to upload success url
     header( "Location: http://www.example.com/thankyou.html" );
    die();
    */

    ?>

On the live simplified form, I have disabled the quote_content_error check so that I did not have to recreate then entire form.

Any ideas as to why this php form does not work as intended? Did I combine the individual forms’ code int a single file incorrectly?

did you edit your form to use name=‘userfile’ too?

Other than that, i’m not seeing a problem in the code that jumps out at me on first pass… is it giving you an error message?

@StarLion The file_upload code worked as written (with the file, upload, userfile wording as is) when it was a seperate file. What changes when I combine the code that makes it not work?

I will move the file_upload code as you advised.

Thanks!

@StarLion I made the changes you advised, but there is no difference in the functionality. I am still not getting a file uploaded. Did I do something else wrong?

Here is my new php code.

<?php
// Configuration - Script Options
$filename = $_FILES[‘userfile’][‘name’]; // Get the name of the file (including file extension)
$file_basename = substr($filename, 0, strripos($filename, ‘.’)); // Get file name minus extension
$file_ext = substr($filename, strripos($filename, ‘.’)); // Get file extension
$filesize = $_FILES[‘userfile’][‘size’]; // Get file size
$allowed_file_types = array(‘.jpg’,‘.jpeg’,‘.gif’,‘.bmp’,‘.png’,‘.pdf’,‘.doc’,‘.docx’,‘.psd’); // These will be the types of files that are allowed to pass the upload validation
$file_counter = 1; // used to increment filename if name already exists
$project = $_REQUEST[‘project’] ;
$project_other = $_REQUEST[‘project_other’] ;
$quantity = $_REQUEST[‘quantity’] ;
$pages = $_REQUEST[‘pages’] ;
$color = $_REQUEST[‘color’] ;
$color_other = $_REQUEST[‘color_other’] ;
$size = $_REQUEST[‘size’] ;
$page_layout = $_REQUEST[‘page_layout’] ;
$stock = $_REQUEST[‘stock’] ;
$stock_other = $_REQUEST[‘stock_other’] ;
$paper_finish = $_REQUEST[‘paper_finish’] ;
$paper_finish_other = $_REQUEST[‘paper_finish_other’] ;
$typeset = $_REQUEST[‘typeset’] ;
$timeframe = $_REQUEST[‘timeframe’] ;
$budget = $_REQUEST[‘budget’] ;
$add_info = $_REQUEST[‘add_info’] ;
$name = $_REQUEST[‘name’] ;
$phone = $_REQUEST[‘phone’] ;
$email = $_REQUEST[‘email’] ;
$company = $_REQUEST[‘company’] ;
$proj_name = $_REQUEST[‘proj_name’] ;
$zip = $_REQUEST[‘zip’] ;
$upload = $_REQUEST[‘upload’] ;

if (!isset($_REQUEST[‘email’])) {
header( “Location: …/pages/quote/quote.html” );
}
if ( ereg( “[\r
]”, $name ) || ereg( “[\r
]”, $email ) ) {
header( “Location: …/pages/quote/quote_injection_error.html” );
}
/*
elseif (empty($name) || empty($phone) || empty($email) || empty($company) || empty($proj_name) || empty($zip) || empty($project) || empty($quantity) || empty($color) || empty($size) || empty($timeframe) || empty($budget)) {
header( “Location: …/pages/quote/quote_content_error.html” );
}
*/
else {
// File renaming and upload functionality
if (in_array($file_ext,$allowed_file_types) && ($filesize < 10000001)) { // Checks to make sure uploaded file(s) is an allowed file type AND within the allowable file size (currently 10MB)

	// Rename File
	$newfilename = $company . '_' . $proj_name . '_' . $file_basename; // Rename file as (CompanyName_FileName_DateStamp)
	// Loop until an available file name is found
	while (file_exists( "file_uploads/" . $newfilename )) {
		$finalfilename = $newfilename . '_' . $file_counter++ . $file_ext; // This will be the File Name shown in the upload destination directory (currently the "file_uploads" directory)
	} if (file_exists("file_uploads/" . $finalfilename)) {
		// file already exists error
		echo "This file already exists. Please rename this file and upload again if necessary."; 
	} else {
		move_uploaded_file($_FILES["userfile"]["tmp_name"], "file_uploads/" . $finalfilename); 
		echo "File uploaded successfully."; 
	} 
}	elseif (empty($file_basename)) {
		// file selection error
		echo "Please select a file to upload."; 
	} elseif ($filesize &gt; 10000000) {
		//file size error
		echo "The file you are trying to upload is too large. Files must be no larger than 10MB."; 
	} else {
		// file type error
		echo "The file you attempted to upload is not allowed. You can only upload the following types of files: .jpg, .jpeg, .gif, .bmp, .png, .pdf, .doc, .docx, and .psd."; 
		unlink($_FILES["userfile"]["tmp_name"]); 
	}
/* 
must add page links for error and success messages: 
	// redirect to upload success url
	 header( "Location: http://www.example.com/thankyou.html" );
	die();
*/
mail( "craig.campbell78@gmail.com", "Request for Quote: $project", 
    "$add_info\

    What kind of project is this? $project\

    Name: $name\

    Name of Project: $proj_name\

    Company: $company\

    Telephone: $phone\

    E-mail Address: $email\

    ZIP code: $zip\

    Is there a file attachment/upload? $upload\

    What do you need a quote on? $project : $project_other\

    What quantity do you require? $quantity\

    If applicable, how many pages is each document? $pages\

    Full color or black and white? $color : $color_other\

    What size do you want your print project to be? $size\

    What type of page layout do you need for your project? $page_layout\

    What paper stock do you require?  $stock : $stock_other\

    What paper finish do you require? $paper_finish : $paper_finish_other\

    Are your documents typeset? $typeset\

    When do you need this project completed by? $timeframe\

    What is your budget for this project? $budget\

    Additional information to help COMPANY prepare our quote for you? $add_info", 
    "From: $name &lt;$email&gt;" ); 
header( "Location: ../pages/quote/quote_thanks.html" ); 
}

// if (isset($_POST[‘submit’])) {
?>

@StarLion I changed everything to “file” on both php and html, reuploaded to server and still not working. There is no error. The form supposedly “work” as in it send me an email of the form data. However the file does not get uploaded and does not exist. Any thoughts?

Here is my HTML:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>File Upload Form</title>
</head>
<body>
<form action=“./sendmail.php” method=“post” enctype=“multipart/form-data”>
<label for=“company”>Company Name:</label><input type=“text” name=“company” id=“company” />
<br />
<label for=“proj_name”>Project Name:</label><input type=“text” name=“proj_name” id=“proj_name” />
<br />
<label for=“file”>Select a File:</label><input type=“file” name=“file” id=“file” />
<br />
<input type=“submit” name=“submit” id=“submit” value=“Upload File” />
</form>
</body>
</html>

Here is my updated php:

<?php
// Configuration - Script Options
$filename = $_FILES[‘file’][‘name’]; // Get the name of the file (including file extension)
$file_basename = substr($filename, 0, strripos($filename, ‘.’)); // Get file name minus extension
$file_ext = substr($filename, strripos($filename, ‘.’)); // Get file extension
$filesize = $_FILES[‘file’][‘size’]; // Get file size
$allowed_file_types = array(‘.jpg’,‘.jpeg’,‘.gif’,‘.bmp’,‘.png’,‘.pdf’,‘.doc’,‘.docx’,‘.psd’); // These will be the types of files that are allowed to pass the upload validation
$file_counter = 1; // used to increment filename if name already exists
$project = $_REQUEST[‘project’] ;
$project_other = $_REQUEST[‘project_other’] ;
$quantity = $_REQUEST[‘quantity’] ;
$pages = $_REQUEST[‘pages’] ;
$color = $_REQUEST[‘color’] ;
$color_other = $_REQUEST[‘color_other’] ;
$size = $_REQUEST[‘size’] ;
$page_layout = $_REQUEST[‘page_layout’] ;
$stock = $_REQUEST[‘stock’] ;
$stock_other = $_REQUEST[‘stock_other’] ;
$paper_finish = $_REQUEST[‘paper_finish’] ;
$paper_finish_other = $_REQUEST[‘paper_finish_other’] ;
$typeset = $_REQUEST[‘typeset’] ;
$timeframe = $_REQUEST[‘timeframe’] ;
$budget = $_REQUEST[‘budget’] ;
$add_info = $_REQUEST[‘add_info’] ;
$name = $_REQUEST[‘name’] ;
$phone = $_REQUEST[‘phone’] ;
$email = $_REQUEST[‘email’] ;
$company = $_REQUEST[‘company’] ;
$proj_name = $_REQUEST[‘proj_name’] ;
$zip = $_REQUEST[‘zip’] ;
$upload = $_REQUEST[‘upload’] ;

if (!isset($_REQUEST[‘email’])) {
header( “Location: …/pages/quote/quote.html” );
}
if ( ereg( “[\r
]”, $name ) || ereg( “[\r
]”, $email ) ) {
header( “Location: …/pages/quote/quote_injection_error.html” );
}
/*
elseif (empty($name) || empty($phone) || empty($email) || empty($company) || empty($proj_name) || empty($zip) || empty($project) || empty($quantity) || empty($color) || empty($size) || empty($timeframe) || empty($budget)) {
header( “Location: …/pages/quote/quote_content_error.html” );
}
*/
else {
// File renaming and upload functionality
if (in_array($file_ext,$allowed_file_types) && ($filesize < 10000001)) { // Checks to make sure uploaded file(s) is an allowed file type AND within the allowable file size (currently 10MB)

	// Rename File
	$newfilename = $company . '_' . $proj_name . '_' . $file_basename; // Rename file as (CompanyName_FileName_DateStamp)
	// Loop until an available file name is found
	while (file_exists( "file_uploads/" . $newfilename )) {
		$finalfilename = $newfilename . '_' . $file_counter++ . $file_ext; // This will be the File Name shown in the upload destination directory (currently the "file_uploads" directory)
	} if (file_exists("file_uploads/" . $finalfilename)) {
		// file already exists error
		echo "This file already exists. Please rename this file and upload again if necessary."; 
	} else {
		move_uploaded_file($_FILES["file"]["tmp_name"], "file_uploads/" . $finalfilename); 
		echo "File uploaded successfully."; 
	} 
}	elseif (empty($file_basename)) {
		// file selection error
		echo "Please select a file to upload."; 
	} elseif ($filesize &gt; 10000000) {
		//file size error
		echo "The file you are trying to upload is too large. Files must be no larger than 10MB."; 
	} else {
		// file type error
		echo "The file you attempted to upload is not allowed. You can only upload the following types of files: .jpg, .jpeg, .gif, .bmp, .png, .pdf, .doc, .docx, and .psd."; 
		unlink($_FILES["file"]["tmp_name"]); 
	}
/* 
must add page links for error and success messages: 
	// redirect to upload success url
	 header( "Location: http://www.example.com/thankyou.html" );
	die();
*/
mail( "craig.campbell78@gmail.com", "Request for Quote: $project", 
    "$add_info\

    What kind of project is this? $project\

    Name: $name\

    Name of Project: $proj_name\

    Company: $company\

    Telephone: $phone\

    E-mail Address: $email\

    ZIP code: $zip\

    Is there a file attachment/upload? $upload\

    What do you need a quote on? $project : $project_other\

    What quantity do you require? $quantity\

    If applicable, how many pages is each document? $pages\

    Full color or black and white? $color : $color_other\

    What size do you want your print project to be? $size\

    What type of page layout do you need for your project? $page_layout\

    What paper stock do you require?  $stock : $stock_other\

    What paper finish do you require? $paper_finish : $paper_finish_other\

    Are your documents typeset? $typeset\

    When do you need this project completed by? $timeframe\

    What is your budget for this project? $budget\

    Additional information to help COMPANY prepare our quote for you? $add_info", 
    "From: $name &lt;$email&gt;" ); 
header( "Location: ../pages/quote/quote_thanks.html" ); 
}

// if (isset($_POST[‘submit’])) {
?>

Well i can tell you immediately your file upload code isnt going to work even if you did get to executing it…

    $filename = $_FILES[[COLOR="Red"]'userfile'[/COLOR]]['name'];
    $filesize = $_FILES[[COLOR="Red"]'file'[/COLOR]]['size']; // Get file size
           move_uploaded_file($_FILES[[COLOR="Red"]"file"[/COLOR]]["tmp_name"], "file_uploads/" . $finalfilename); 
           unlink($_FILES[[COLOR="Red"]"file"[/COLOR]]["tmp_name"]); 
<input title="Upload a file for your project." type="file" name="[COLOR="Red"]upload[/COLOR]" id="upload" tabindex="26" /> 

Every single one of the red words above should be the same word, not 3 different ones.

Now that I see your upload is part of the same form, and not an entirely seperate one, you need to move your file-upload code, in it’s entirity, up to right before

    mail( "QUOTES@DOMAIN.com", "Request for Quote: $project", 

in order for it to execute when your form sends out an email.

PS: Thanks Ralph!

include('thankyou.php');
die();

That way you’re not adding things to the user’s browser history. (If you forward them to a thank you page, and they hit back, they go back to the form processer, and get asked that annoying “Do you want to send form data again” bit)

My point, though, is that you’ve tacked the upload form code into the bottom of the other form’s code - without giving the script a way of knowing WHICH form has been submitted.

I’ll need to see your forms HTML in order to answer this further.

@StarLion here is the form HTML.

Also, if I replace all my header()'s with include()'s will that cause any problems with the current code or do I need to make any other changes with this edit?

<form id="rfq" method="post" action="../../php/DOMAIN_sendmail.php" enctype="multipart/form-data" > 
								<fieldset id="project_details"> 
									<legend>Request for Printing Quote</legend> 
									<p class="other_details"> 
										<label for="project">What type of project do you need a quote for? <span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<select name="project" id="project" tabindex="1"> 
											<option title="Select your project type" value="">Select the Type of Project</option> 
											<option title="Select your project type" value="Custom Business Cards">Custom Business Cards</option> 
											<option title="Select your project type" value="Business Letterhead">Business Letterhead</option> 
											<option title="Select your project type" value="Printed Flyers">Printed Flyers</option> 
											<option title="Select your project type" value="Grinding Wheel Blotters">Grinding Wheel Blotters</option> 
											<option title="Select your project type" value="Newsletter Printing">Newsletter Printing</option> 
											<option title="Select your project type" value="Promotional Gifts">Promotional Gifts</option> 
											<option title="Select your project type" value="Postcard Printing">Postcard Printing</option> 
											<option title="Select your project type" value="Brochure Printing">Brochure Printing</option> 
											<option title="Select your project type" value="Color Copies">Color Copies</option> 
											<option title="Select your project type" value="Banner Printing">Banner Printing</option> 
											<option title="Select your project type" value="Printed Books">Printed Books</option> 
											<option title="Select your project type" value="Graphic Design">Graphic Design</option> 
											<option title="Select your project type" value="Logo Design">Logo Design</option> 
											<option title="Select your project type" value="Other">Other (please specify)</option> 
										</select> 
											<br /> 
										<label for="project_other" class="other_details">Other:</label> 
										<input type="text" title="Please specify your project type" name="project_other" id="project_other" class="other_details" tabindex="2" /> 
									</p> 
									<p> 
										<label for="quantity">What quantity do you require? <span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="What quantity do you require?" name="quantity" id="quantity" tabindex="3" /> 
									</p> 
									<p> 
										<label for="pages">If applicable, please specify how many pages you need for each document:</label> 
										<br /> 
										<input type="text" title="How many pages per document are needed?" name="pages" id="pages" tabindex="4" /> 
									</p> 
									<p class="other_details radio">Do you require full color or black and white printing? <span class="important">&nbsp;[required]</span> 
										<br /> 
										<input type="radio" title="Select your color needs." name="color" id="color" value="Full Color" tabindex="5" /> 
										<label for="color">&nbsp;Full Color</label> 
										<br /> 
										<input type="radio" title="Select your color needs." name="color" id="color" value="Black &amp; White" tabindex="6" /> 
										<label for="color">&nbsp;Black &amp; White</label> 
										<br /> 
										<input type="radio" title="Select your color needs." name="color" id="color" value="Other" tabindex="7" /> 
										<label for="color">&nbsp;Other (please specify)</label> 
										<br /> 
										<label for="color_other" class="other_details">Other:</label> 
										<input type="text" title="Please specify your color needs." name="color_other" id="color_other" class="other_details" tabindex="8" /> 
									</p> 
									<p> 
										<label for="size">What size do you want your print project to be? <span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Specify your document size." name="size" id="size" tabindex="9" />									
									</p> 
									<p>What type of page layout do you need for your print project?
										<br /> 
										<input type="radio" title="Select your desired page layout." name="page_layout" id="page_layout" value="Single Sided" tabindex="10" /> 
										<label for="page_layout">&nbsp;Single Sided</label> 
										<br /> 
										<input type="radio" title="Select your desired page layout." name="page_layout" id="page_layout" value="Double Sided" tabindex="11" /> 
										<label for="page_layout">&nbsp;Double Sided</label> 
									</p> 
									<p class="other_details"> 
										<label for="stock">What paper stock do you require?</label> 
										<br /> 
										<select name="stock" id="stock" tabindex="12"> 
											<option title="Select your desired paper stock." value="">Select Paper Stock</option> 
											<option title="Paper Stock: 20# Bond." value="20# Bond">20# Bond</option> 
											<option title="Paper Stock: 24# Watermarked Bond." value="24# Watermarked Bond">24# Watermarked Bond</option> 
											<option title="Paper Stock: Cover Stock." value="Cover Stock">Cover Stock</option> 
											<option title="Paper Stock: Coated Text." value="Coated Text">Coated Text</option> 
											<option title="Paper Stock: Coated 1/Side Cover." value="Coated 1/Side Cover">Coated 1/Side Cover</option> 
											<option title="Paper Stock: Coated 2/Side Cover." value="Coated 2/Side Cover">Coated 1/Side Cover</option> 
											<option title="Paper Stock: Other. Please Specify below.." value="Other">Other (specify below)</option> 
										</select> 
											<br /> 
										<label for="stock_other" class:"other_detail_input" class="other_details">Other:</label> 
										<input type="text" title="Please specify your desired paper thickness." name="thckness_other" id="thickness_other" class="other_details" tabindex="13" /> 
									</p> 
									<p class="other_details">What paper finish do you require?
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Smooth" tabindex="14" /> 
										<label for="paper_finish">&nbsp;Smooth</label> 
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Vellum" tabindex="15" /> 
										<label for="paper_finish">&nbsp;Vellum</label> 
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Silk" tabindex="16" /> 
										<label for="paper_finish">&nbsp;Silk</label> 
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Linen" tabindex="17" /> 
										<label for="paper_finish">&nbsp;Linen</label> 
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Laid" tabindex="18" /> 
										<label for="paper_finish">&nbsp;Laid</label> 
										<br /> 
										<input type="radio" title="Select your paper finish." name="paper_finish" id="paper_finish" value="Other" tabindex="19" /> 
										<label for="paper_finish">&nbsp;Other</label> 
										<br /> 
										<label for="paper_finish_other" class:"other_detail_input" class="other_details">Other:</label> 
										<input type="text" title="Please specify your paper finish." name="paper_finish_other" id="paper_finish_other" class="other_details" tabindex="20" /> 
									</p> 
									<p>Are your documents formatted and ready for print (i.e. typset)?
										<br /> 
										<input type="radio" title="Are your documents typset?" name="typeset" id="typeset" value="Yes" tabindex="21" /> 
										<label for="typeset">&nbsp;Yes</label> 
										<br /> 
										<input type="radio" title="Are your documents typset?" name="typeset" id="typeset" value="No" tabindex="22" /> 
										<label for="typeset">&nbsp;No</label> 
									</p> 
									<p> 
										<label for="timeframe">When do you need the project completed? <span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<select name="timeframe" id="timeframe" tabindex="23"> 
											<option title="Select your desired timeframe." value="">Select Your Timeframe</option> 
											<option title="Select your desired timeframe." value="Rush (less than 2 days)">Rush (less than 2 days)</option> 
											<option title="Select your desired timeframe." value="2-3 Days">2-3 Days</option> 
											<option title="Select your desired timeframe." value="1 Week">1 Week</option> 
											<option title="Select your desired timeframe." value="2 Weeks">2 Weeks</option> 
											<option title="Select your desired timeframe." value="1 Month">1 Month</option> 
											<option title="Select your desired timeframe." value="6 Months">6 Months</option> 
											<option title="Select your desired timeframe." value="Unknown">Unknown</option> 
										</select> 
									</p> 
									<p> 
										<label for="budget">What is your budget for this project? <span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<select name="budget" id="budget" tabindex="24"> 
											<option title="Select your project budget." value="">Select Your Budget</option> 
											<option title="Select your project budget." value="$25 - $50">$25 - $50</option> 
											<option title="Select your project budget." value="$50 - $100">$50 - $100</option> 
											<option title="Select your project budget." value="$101 - $250">$101 - $250</option> 
											<option title="Select your project budget." value="$251 - $500">$251 - $500</option> 
											<option title="Select your project budget." value="$501 - $750">$501 - $750</option> 
											<option title="Select your project budget." value="$751 - $1,000">$751 - $1,000</option> 
											<option title="Select your project budget." value="$1,001 - $1,500">$1,001 - $1,500</option> 
											<option title="Select your project budget." value="$1,501 - $2,500">$1,501 - $2,500</option> 
											<option title="Select your project budget." value="over $2,500">over $2,500</option> 
											<option title="Select your project budget." value="Unknown">Unknown</option> 
										</select> 
									</p> 
									<p> 
										<label for="add_info">Additional information to help DOMAIN prepare our quote for you:</label> 
										<br /> 
										<textarea title="Additional information will assist DOMAIN in preaparing a proposal for your poject." name="add_info" id="add_info" rows="11" cols="30" tabindex="25"></textarea> 
									</p> 
									<p> 
										<input type="hidden" name="MAX_FILE_SIZE" value="3145728" /> 
										<label for="upload">Upload a file:</label> 
										<br /> 
										<input title="Upload a file for your project." type="file" name="upload" id="upload" tabindex="26" /> 
									</p> 
								</fieldset> 
								<fieldset id="contact_details"> 
									<legend>Contact Details</legend> 
									<p>Final step - please enter your contact details. Please note all fields are <span class="important">[required]&nbsp;</span>.</p> 
									<p> 
										<label for="name">Name<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your name." name="name" id="name" tabindex="27" /> 
									</p> 
									<p> 
										<label for="email">Email<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your email address." name="email" id="email" tabindex="28" /> 
									</p> 
									<p> 
										<label for="phone">Daytime Phone Number<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your phone number." name="phone" id="phone" tabindex="29" /> 
									</p> 
									<p> 
										<label for="company">Company Name<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your company name." name="company" id="company" tabindex="30" /> 
									</p> 
									<p> 
										<label for="proj_name">Project Name<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your role in this project." name="proj_name" id="proj_name" tabindex="31" /> 
									</p> 
									<p> 
										<label for="zip">ZIP Code<span class="important">&nbsp;[required]</span></label> 
										<br /> 
										<input type="text" title="Enter your ZIP code." name="zip" id="zip" tabindex="32" /> 
									</p> 
								</fieldset> 
								<p>If you've completed all the <span class="important">[required]</span>&nbsp;questions above, please click the &quot;Request a Quote&quot; button below to send your request. A DOMAIN' representative will contact you in 24-48 hours or less.</p> 
								<input type="submit" title="Request a quote for your next print project." value="Request a Quote" tabindex="33" /> 
							</form>

@StarLion

Upon form submission, the form data is emailed to me and formated as intended in the php code. The user is then redirected to a thank you page. I do not remember specifically what the line of code does, but the original sendmail.php file worked as intended before I added the file_upload code to the file.

Again I am less than new to php and only able to pick up things from tutorials. Why shouldn’t I use header? What would I use instead to open a new 'Thank You" page for example?

What is it with people and using header lately?

Anyway.

Dont see a link to your form, but i’m guessing the problem is that you’re not gating correctly.

if (!isset($_REQUEST[‘email’])) {
header( “Location: …/pages/quote/quote.html” );
}

So does your file upload form send an email field? If not, this check will send them to the quote page.