Reply to Re: php script running as a cgi

Your name:

Reply:


Posted by "zedleon" on 10/04/44 11:37

here is the php code i am using as a cgi in the cgi-bin
This form executes fine, just doesn't get the variables for the form.

simple test form at:
http://www.passeycorp.com/gnupg.php

thanks for the feedback.

zed
-----------------------------------------------------------------------

#!/usr/local/bin/php -q

<?

$msg = "Sender's Full Name:\t$_POST[sender_name]\n";

$msg .= "Sender's E-Mail:\t$_POST[sender_email]\n";
$msg .= "Secret Message?\t$_POST[sender_msg]\n\n";

putenv("GNUPGHOME=/home/account_name/.gnupg");

$username = "passey";

$tmpToken = md5(uniqid(rand()));

$plainTxt = "/home/account_name/temp/input/" . "$tmpToken" . "data";
$crypted = "/home/account_name/output/" . "gpgdata";

$fp = fopen($plainTxt, "w+");
fputs($fp, $msg);
fclose($fp);

system("/usr/bin/gpg --encrypt -ao $crypted -r 'ted passey' $plainTxt");

$fd = fopen($crypted, "r");
$mail_cont = fread($fd, filesize($crypted));
fclose($fd);

unlink($plainTxt);
unlink($crypted);

$recipient = "your@email.com";
$subject = "Stupid Secret Message";

$mailheaders = "From: www.yourwebsite.com\n";
$mailheaders .= "Reply-To: $sender_email\n\n";

mail("$recipient", "$subject", $mail_cont, $mailheaders);

echo "
<H1 align=center>Thank You, $sender_name</h1>
<p align=center>Your secret message has been sent.</p>";

?>


""zedleon"" <support@passeycorp.com> wrote in message
news:08.40.13436.FFCBBC34@pb1.pair.com...
> I am running a php script as a cgi so to be able to run under my user
name.
> The script seems to be working except for one major problem.....
> the cgi script is not finding the variables passed by the html form...
>
> Any suggestions on how to make this work?
>
> Any help is greatly appreciated -
>
> zed

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация