- This topic is empty.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
March 19, 2012 at 11:16 pm #37237
kgscott284
ParticipantOK, so…I am currently working on an email form for a client who wants to use the following encryption to encrypt emails sent from his site ( please don’t ask me why, I haven’t the slightest idea why lol)…
function encode($thetext)
{
$iv = "51901410686694700275125677623053";
$key = "super secret encryption key";
$text = $thetext;
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
$padding = $block - (strlen($text) % $block);
$text .= str_repeat(chr($padding), $padding);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CBC, $iv);
$encodedMsg = base64_encode($crypttext);
return ($encodedMsg) . "n
";
}
?>
My Problem is, I cannot figure out how to get the encode() function to parse the posted data and properly display in the email sent from the server…Here is my email script as is stripped as much as possible
$recipient = "[email protected]";
$subject = "Super Secret Encrypted Message";
$name = encode($_REQUEST);
$contactPref = encode($_REQUEST);
$email = encode($_REQUEST);
$phone = encode($_REQUEST);
$state = encode($_REQUEST);
$county = encode($_REQUEST);
$primary = encode($_REQUEST);
$clinic = encode($_REQUEST);
$docCity = encode($_REQUEST);
$inquiry = encode($_REQUEST);
$emailBody .= "Name: " . $name;
$emailBody .= "Contact Preference: " . $contactPref;
$emailBody .= "Email: " . $email;
$emailBody .= "Phone: " . $phone;
$emailBody .= "State: " . $state;
$emailBody .= "County: " . $county;
$emailBody .= "Primary Care: " . $primary;
$emailBody .= "Clinic Name: " . $clinic;
$emailBody .= "Physician's City: " . $docCity;
$emailBody .= "Questions/Comments: " . $inquiry;
mail($recipient, $subject, $emailBody, "From: $email");
?>
And Of course, that doesn’t work…It shoots me a 500 error :(
If anyone has any suggestions i would more than appreciate it!
Thanks guys…The solution is simple and on the tip of my tongue but i just can’t get it out.
p.s. I removed all validation and comments to make it really really minimal…
-
AuthorPosts
Viewing 1 post (of 1 total)
- The forum ‘Back End’ is closed to new topics and replies.