Re: POST without POSTing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 1, 2009 at 00:16, Paul M Foster <paulf@xxxxxxxxxxxxxxxxx> wrote:
>
> However, assuming it *wasn't*, I've found the following example from a
> google search (thank goodness for google's "hinting" or I couldn't have
> found it):
>
> $fp = fsockopen("www.site.com", 80);
> fputs($fp, "POST /script.php HTTP/1.0
> Host: www.site.com
> Content-Length: 7
>
> q=proxy");
>
> I don't know much about doing things this way. It appears that when done
> this way, the "body" must be separated by a newline, just like email.
> And it appears that the content-length of 7 indicates the length of the
> "q=proxy" string. Assuming I piled on a few other passed variables the
> same way as "q", separated by newlines (and adjusted the Content-Length
> accordingly), would the above work? Are there liabilities to doing it
> this way?

    Yes.  Hosts are more likely to have cURL installed and available
than fsockopen() or URL-based fopen() calls, so portability is greater
with cURL.  It's also a bit faster.  Still, as you know, there's
always more than one way to skin a cute, furry, delicious little
kitten.

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux