vi_srikanth has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am having a CPP program which calls the Perl script http://mywebsite.com/upload.pl. This CPP program passes a few POST variables (userfile, accemailid and comment). But, I am not getting ANY post vairable in the upload.pl! Here is the code snippet of the upload.pl:
my $query=new CGI; my $emailid = $query->param('accemailid'); print TMP time; # Just to check whether the file gets executed print TMP $emailid; # TMP is a file handler of a temp file
The above program gets executed(time gets printed), but I am not getting any value in the variable $emailid! Instead of through CPP program, if I try the URL of the CGI script through a HTML form submit, it works precisely (both GET as well as POST).
I wrote a PHP script which almost does the above. Here is the code:
It works precisely through CPP program!!!!$emailid = $_POST['accemailid']; $logfile = "/tmp/in/log.txt"; $fh = fopen($logfile, 'a') or die("can't open file"); fwrite($fh, $emailid); fclose($fh);
Here is the CPP code snippet:
_LIT8(KPostUri, "http://mywebsite.com/upload.pl"); _LIT8(KDataStart,"--AaB03x"); _LIT8(KCrlf,"\r\n"); _LIT8(KContent,"Content-Disposition: form-data; name='userfile'; f +ilename='"); _LIT8(KFileCompletion,"'"); _LIT8(KContentEmail,"Content-Disposition: form-data; name='accemai +lid'"); _LIT8(KContentComment,"Content-Disposition: form-data; name='comme +nt'");
Any idea why the perl script is not getting the variables? Kindly help.
Thanks
Srikanth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI - Not getting POST Variables
by jdtoronto (Prior) on Aug 03, 2006 at 12:16 UTC | |
by vi_srikanth (Acolyte) on Aug 03, 2006 at 13:39 UTC | |
by jhourcle (Prior) on Aug 03, 2006 at 13:49 UTC | |
by jdtoronto (Prior) on Aug 03, 2006 at 16:17 UTC | |
by vi_srikanth (Acolyte) on Aug 05, 2006 at 11:48 UTC | |
| |
by vi_srikanth (Acolyte) on Aug 03, 2006 at 13:52 UTC | |
by jhourcle (Prior) on Aug 03, 2006 at 14:12 UTC |