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
In reply to CGI - Not getting POST Variables by vi_srikanth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |