dmsparts has asked for the wisdom of the Perl Monks concerning the following question:
any help will be appreciated Michael I have now got the script working but i neet to make it retuen a HTTP 200 status back to the server that calls the script once it has executed. I cannot find any way to do this. Please help. Cheerssub smsreply { $smsreply = 'd:\inetpub\wwwroot\cgi-bin\classads\test'; { local ($buffer, @pairs, $pair, $name, $value, %FORM)}; # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CON +TENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } # Split information into name/value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value = +~ tr/+/ /; $postFields{ "$name" } = $value; $from = $postFields{ "from" }; $msg = $postFields{ "text" }; $msgid = $postFields{ "msgid" }; $msg =~ s/%(..)/pack("C", hex($1))/eg; open (SMSREPLY, ">>$smsreply/$msgid.txt"); print SMSREPLY "\n$from $msg $msgid"; close SMSREPLY; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: http POST replies
by olus (Curate) on Aug 19, 2008 at 11:57 UTC | |
|
Re: http POST replies
by Anonymous Monk on Aug 19, 2008 at 11:56 UTC | |
by Anonymous Monk on Aug 19, 2008 at 12:00 UTC | |
|
Re: http POST replies
by zentara (Cardinal) on Aug 19, 2008 at 12:57 UTC | |
by dmsparts (Sexton) on Aug 19, 2008 at 13:11 UTC | |
by CountZero (Bishop) on Aug 19, 2008 at 15:46 UTC | |
by Anonymous Monk on Aug 19, 2008 at 13:27 UTC | |
|
Re: http POST replies
by SFLEX (Chaplain) on Aug 19, 2008 at 12:29 UTC | |
by Anonymous Monk on Aug 19, 2008 at 12:38 UTC | |
|
Re: http POST replies
by geira (Initiate) on Aug 19, 2008 at 12:48 UTC |