Hope someone can help me debug this code !
<?
// Send my variables to encrypt.php
// ################################
$Name="Peter";
$read="Please read the following\n";
$message="This is a test";
$line1 = "Encryption test for $Name - $read\n\n";
$line2 = "Secret message: $message\n\n";
$footer="Was this test a success ??\n";
Header("Location: http://mydomain.com/encrypt.php?pgp_key=MyKey&line1=$line1&line2=$line2&footer=$footer");
?>
<?
// The encryption script "encrypt.php"
/* ###################################
PGP command line usage summary for my system (through Telnet).
To encrypt plaintext file with recipient's public key, type:
pgp -e textfile keyName (produces textfile.pgp)
To encrypt with conventional encryption only:
pgp -c textfile
To produce output in ASCII for email, add the -a option to other options.
*/
$mailprog = "/usr/sbin/sendmail";
$pgp_version = "2.6.2";
// specify the path to PGP executable on the server.
$pgp_path = "/usr/local/bin/pgp";
// specify the path to public/private key files and pgp config file
$pgp_config_files = "/web/www/.pgp";
// $pgp_temp_file_path, the location of a folder that PGP can write
// temporary files. File permissions must allow web visitor to write in it.
$pgp_temp_file_path ="/web/www/temp";
// # END CONFIGURATION VARIABLES
$keyName="MyKey";
$MyEmail="vista@emi.net"; //hardcoded for testing
// ####### PUT BODY OF MESSAGE INTO A VARIABLE ########
// Concatenate all my message variables
// $email_body = "$line1.$line2.$footer.$footer";
$email_body = "$line1$line2$footer";
// ######## ENCRYPT BODY OF MESSAGE ##########
// Not sure what to do here
$email_body = "pgp_encrypt($email_body)";
$email_body = "\n" . $email_body . "\n";
// ######## END - ENCRYPT BODY OF MESSAGE ########
/* this is what the command looks like in a Perl script I saw,
not sure it applies to PHP !
$pgp_path -feat +VERBOSE=0 $pgp_public_key_user_id >$output_file";
*/
$pgp_command = "$pgp_path -feat +VERBOSE=0 $keyName >$output_file";
// /usr/local/bin/pgp . " -f -e -a -t " . $keyName . " +0 " .
//$result = exec($command, $encrypted, $errorcode);
// return($pgp_output);
if ($errorcode){
echo "Error $errorcode encrypting your data.<BR>\n";
echo "Please check paths & permissions.<BR>\n";
exit;
}
// ###### Send the encrypted email to $MyEmail #######
@mail("$MyEmail","Test", "$email_body", "From: vista@emi.net");
?>