Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've just tried it, and I'm getting 500 internal server errors. This is the original perl code I was using (the variables have been changed to *'s for security reasons):-
#!/usr/bin/perl use LWP; &ReadParse; $timetoget = time; &GetDate; &AssignVariables; $paytox = &DoGet($urltopost); print "Content-type: text/html\n\n"; if ($paytox ne "") { print "AUTHORISED PAYMENT<br><br>"; print "Response recieved...<br><br>$paytox"; } else { print "DECLINED PAYMENT<br><br>"; print "No response..."; } exit; sub ReadParse { local (*in) = @_ if @_; local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" ) { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } else { $in = ( grep( !/^-/, @ARGV )) [0]; $in =~ s/\\&/&/g; } @in = split(/&/,$in); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; } return length($in); } sub AssignVariables { $userid = "***"; $xpin = "****"; $xhash = "*****"; $transid = $in{'trans_id'}; $urltopost = "https://www.paytox.com/?cmd=retrieve_trans&user_id=$ +userid&xipn=$xpin&xhash=$xhash&trans_id=$transid"; } sub DoPost { $browser = LWP::UserAgent->new( ) unless $browser; my $resp = $browser->post(@_); return ($resp->content, $resp->status_line, $resp->is_success, $resp +) if wantarray; return unless $resp->is_success; return $resp->content; } sub DoGet { $browser = LWP::UserAgent->new( ) unless $browser; my $resp = $browser->get(@_); return ($resp->content, $resp->status_line, $resp->is_success, $resp +) if wantarray; return unless $resp->is_success; return $resp->content; } sub GetDate { @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Frida +y','Saturday'); @months = ('jan','feb','mar','apr','may','jun','jul','aug','sep',' +oct','nov','dec'); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime( +$timetoget); $year = $year+1900; $Date = "$days[$wday] $months[$mon]/$mday/$year"; }

In reply to Re^2: $20 For Coding Help by copland
in thread Reaped: $20 For Coding Help by NodeReaper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (4)
    As of 2020-12-04 05:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How often do you use taint mode?





      Results (58 votes). Check out past polls.

      Notices?