Our customer’s fill out the online form confirming to us that they comply with some industry regulations that are set forth. From there, they are supposed to file out an industry wide form and fax it to us. But, I’m trying to make it easy by simply allowing them to attach the industry form in their attestation of compliance, instead of making it two separate steps for them.
The code you copied in your response was done by someone else, so I have no idea about that. lol
I was trying to fix the code, and now I get “Server Error: The website encountered an error while retreiving (url.php). It may be down for maintenance or configured incorrectly.”
Err. Here’s the php that is “configured incorrectly”
[php]<?php
$subject = 'I am Compliant from ‘.$_POST[‘MID’].’ ';
$emailadd = ‘[email protected]’;
$url = ‘compliance/confirmation.html’;
$req = ‘1’;
$text = “I declare that I have read and understand the Guidelines and that I comply within these guidelines.
:\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)
{echo “Name of form element $key cannot be longer than 20 characters”;die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ’ ‘;}
$value = str_replace(’\n’, “$line”, $value);
$conc = “{$key}:$space{$value}$line”;
$text .= $conc;
$space = ’ ';
}
$file_name = $_FILES[‘userfile’][’’.$_POST[‘MID’].’’];
$random_digit=rand(0000,9999);
$new_file_name = $file_name . $random_digit;
$path= “Confirmation/” . $new_file_name;
if($userfile !=none) {
if(copy($_FILES[‘userfile’][‘tmp_name’], $path)) {
echo “Successful
”;
echo “File Name :” . $new_file_name."
";
echo “File Size :” . $_FILES[‘userfile’][‘size’]."
";
echo “File Type :” . $_FILES[‘userfile’][‘type’]."
";
} else {
echo “Error, file did not upload correctly!”;
}
mail($emailadd, $subject, $text, $header);
echo ‘’;
?>
[/php]
Did i insert the code you provided me in the wrong place (just before the mail command)?