Re: fsockopen() and POST

From: Date: Sat, 06 Jan 2001 01:19:13 +0000
Subject: Re: fsockopen() and POST
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32991@lists.php.net to get a copy of this message
Feel free to look at this piece of code of mine. http://www.nirvani.net/software/SmartBeep_PageIT_Plus/SmartBeep_PageIT_Plus-1.0.1.php.asc It has a POST function which you can rip out. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Fri, 5 Jan 2001, Jeff Warrington wrote: > Date: Fri, 05 Jan 2001 17:15:18 -0800 > From: Jeff Warrington <jaydub@bossanova.com> > To: php-general@lists.php.net > Subject: Re: [PHP] fsockopen() and POST > > In article <3A4D156C.98E03DD1@aristesoftware.com>, "Todd Cary" > <todd@aristesoftware.com> wrote: > > > I am trying to send data via a socket and the POST method. I have no > > problems with the GET, but the POST is not putting anything into the > > $HTTP_POST_VARS array. Here is what I am sending: > > > > POST http://209.204.172.138:80/hec/php/purchaseinfo.php > > HTTP/1.0 Host: > > 209.204.172.137:80 Content-type: application/x-www-form-urlencoded > > Content-length: 11 test=123456 > > > > I am assuming that between each header key/value pair you are > entering both a carriage return (\r) and a newline (\n). > > After your last header field and the start of your POST data, you need to > include 2 cr and newlines (\r\n\r\n). > > Should be okay after that. > > A code snippet: > > fputs($fp, "POST $scriptPath HTTP/1.1\r\n"); > fputs($fp, "Host: $host\r\n"); > if (is_array($cookies)) { > while (list($key, $val) = each($cookies)) { > fputs($fp, "Cookie: $key=$val\r\n"); > } > } > fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); > fputs($fp, "Content-length: ".strlen($POSTvars)."\r\n"); > fputs($fp, "Connection: close\r\n\r\n"); > fputs($fp, $POSTvars); > > Jeff > > > > Is there some glaring error?? > > > > Todd > > > > -- > > Todd Cary Ariste Software todd@aristesoftware.com > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#32991) next »