Page 2 of 2

Posted: Tue May 17, 2005 3:20 am
by icarpenter
hedge wrote:Check out this link for some functions I wrote to do a POST using fsockopen viewtopic.php?t=7063 You could also use CURL or snoopy.
Thanks for that I tried...

Code: Select all

$fp = @fsockopen("//localhost", 80);
  if ($fp) {
    fputs($fp, "POST //localhost/mydirectory/index.php?test=test\r\n");
    fputs($fp, "Host: //localhost");
    fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
    fputs($fp, "Content-length: " . strlen(10) . "\r\n");
    fputs($fp, "Connection: close\r\n\r\n");
    fclose($fp);
But no banana!!!

I know this is wrong but would be great if you could push me in the right direction?