in reply to CGI - Not getting POST Variables

Why not try dumping the query and see what is there?
use Data::Dumper; my $query=new CGI; print TMP Dumper($query); 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
jdtoronto

Replies are listed 'Best First'.
Re^2: CGI - Not getting POST Variables
by vi_srikanth (Acolyte) on Aug 03, 2006 at 13:39 UTC

    Hi

    This is the dump:

    $VAR1 = bless( { '' => [ '??JFIFdd?Duckyd?Adobed??? !1AQa"q#?BR??$ 3%C!1AQaq"??#?Rb 3r?$? ???R}}}+?@*U?S0+???y:???? +?tvY?Md?HC R(A\\6\'?O?m)@?k ?\\+??s?pa9?lR)?I6 ?Z*ZzisN?\'?~f, W??RQh?%@?z+J?e} ??+wR+X?k?:@fiD?pKSgM:?7$?/?+?(>W???s?ib??uS?I6L ?OT?>C?:X?Z)P?(@?+??Q +?>k?:|}:An4Qx?MP/C?IuL3 ?V?O?S??!UJ\'?Z?3j??u?w?-M???$????z+l??Mj?`i?Q?)N-?z?hwG? +?|t+?]8R??_?$???P|??6!0?\\+???,s7E8RM e�I.ꐋZj_M?�5� X?�, . . . More such junk . . 'ztjgj@jmj.com', '', 'Myapp', 'Public' ], '.parameters' => [ '' ], '.charset' => 'ISO-8859-1', '.etab' => 1, '.elid' => 1, '.fieldnames' => {}, '.header_printed' => 1, 'escape' => 1 }, 'CGI' );

    I dont know why I am getting junk characters. Instead of calling the CGI program through CPP program, if I try through HTML form (Get or Post) the Dump seems to be perfect, i.e. I get all the parameters without any junk characters. Any idea?

    Thanks
    Srikanth

      It sounds to me like the problem's in the C++ web client, not the perl backend. You might want to sniff the connection, and see exactly what the client is sending, as it doesn't seem to be serializing the values correctly. (or it's using some sort of encoding that I'm not familiar with, and the perl script doesn't understand)

        Header compression would certainly seem a logical culprit, I would try something like ethereal to sniff what is actually being sent by the client.

        jdtoronto

        If there is problem with C++ web client, then the PHP script should also NOT work... right? But, it is working perfectly!!!