unable to reader the parameters from the http post method

2005-02-01 Thread Jayadev sadineni
hi,

I'm trying send the 

char * request = "POST /cgi-bin/sample.pl HTTP/1.1\x0D\x0AHost: 192.168.1.89:443\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0Abirthday=jan0104";

and a CGI script(sample.pl) was written at the server side whichreeads the request , and I'ma trying to print theheader data butunable to get.
Here is the followingsample.pl (perl code) :

#!/usr/bin/perl
$size_of_form_information = $ENV{'CONTENT_LENGTH'};read (STDIN, $form_info, $size_of_form_information);
$form_info =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
($field_name, $birthday) = split (/=/, $form_info);
print "Content-type: text/plain", "\n\n";print header;print "Len:$size_of_form_information\n";print "Test:$form_info\n";print "Hey, your birthday is on: $birthday. That's what you told me, right?", "\n";
exit (0); Regards,
dev



Yahoo! India Matrimony: Find your life partner
online.

Re: unable to reader the parameters from the http post method

2005-02-01 Thread Craig Edwards
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
you should probably use sysread in the perl, and youre missing
Content-Length headers at both ends. Just what i noticed from a quick
glance, you'd probably be better off using the perl CGI modules too.
Thanks,
Craig
Jayadev sadineni wrote:
| hi,
|
| I'm trying send the
|
|  char * request = POST /cgi-bin/sample.pl HTTP/1.1\x0D\x0AHost:
192.168.1.89:443\x0D\x0A\x43onnection:
Close\x0D\x0A\x0D\x0Abirthday=jan0104;
|
| and a CGI script(sample.pl) was written at the server side which
reeads the request , and I'ma trying to print the header data but unable
to get .
| Here is the following sample.pl (perl code) :
|
| #!/usr/bin/perl
| $size_of_form_information = $ENV{'CONTENT_LENGTH'};
| read (STDIN, $form_info, $size_of_form_information);
| $form_info =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack (C, hex ($1))/eg;
| ($field_name, $birthday) = split (/=/, $form_info);
| print Content-type: text/plain, \n\n;
| print header;
| print Len:$size_of_form_information\n;
| print Test:$form_info\n;
| print Hey, your birthday is on: $birthday. That's what you told me,
right?, \n;
| exit (0);
|
| Regards,
| dev
|
|
|
| Yahoo! India Matrimony: Find your life partneronline.
- --
WinBot IRC client developer: http://www.winbot.co.uk
ChatSpike - The users network: http://www.chatspike.net
InspIRCd - Modular IRC server: http://www.inspircd.org
Online RPG Developer: http://www.ssod.org
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB/9+00k42Wxli/BARAtP2AJ9txefYLQMrdhDqrYZOJBR8dKUgPACfdlCT
gPZ2xTAipQ8BGG3YD5OfURE=
=T1rx
-END PGP SIGNATURE-
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]