HTTP POST..
| From: | ReDucTor | Date: | Mon, 10 Sep 2001 16:26:59 +0000 |
| Subject: | HTTP POST.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-66658@lists.php.net to get a copy of this message | ||
Ok,
Let me explain my situation...
I am trying to make an autoresponder, I want to make it in PHP, I am using
qmail, so in PHP what i was hoping to do was read STDIN, and put in my
.qmail the path to php, then the script, but I don't know where php is
located on the server(not my server, i've tried the common paths, they don't
respond to emails), so now what i have done is made a perl script, that go's
to the url of the php script, but it doesn't appear to work reading stdin
from there, so now what i am wanting to do is capture stdin in the perl
script, then POST it into the PHP script...here is what I have in the perl
script so far...
#!/usr/bin/perl
use IO::Socket;
$host = "www.domain.com";
$EOL = "\015\012";
$BLANK = $EOL x 2;
$document = "autoresponder.php";
$remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
$remote->autoflush(1);
print $remote "GET http://$host/$document HTTP/1.1".
$EOL;
print $remote "HOST: ". $host. $BLANK;
while ( <$remote> ) { }
close $remote;
BTW I have been looking at RFC 2616 informatino, but Havn't managed to find
anything...
- James "ReDucTor" Mitchell