[ Home Home | Account | Shoping Shopping Cart (0) | Sitemap | Contact ]

[ Language ]

Frequently Asked Questions

PHP! Hypertext Preprocessor FAQ:

How can I send variables from a PHP script to another URL using POST without using forms and hidden variables?

You can open an HTTP socket connection and send HTTP POST commands. Here is
an example:

// PHP Code
// Generate the request header
$ReqHeader =
"POST $URI HTTP/1.1\n".
"Host: $Host\n".
"Content-Type: application/x-www-form-urlencoded\n".
"Content-Length: $ContentLength\n\n".
"$ReqBody\n";

// Open the connection to the host
$socket = fsockopen($Host, 80, &$errno, &$errstr);
if (!$socket)

$Result["errno"] = $errno;
$Result["errstr"] = $errstr;
return $Result;
}
$idx = 0;
fputs($socket, $ReqHeader);
while (!feof($socket))

$Result[$idx++] = fgets($socket, 128);
}
//-------------------------------------------





  • Red Hat
  • Microsoft
  • PHP
  • MYSQL
  • Macromedia
  • Google
  • 2Checkout

[ Site Map | Contact Us | XHTML | CSS ] ©1999-2008 Exiqze.com, US: +(1) 617-848-9286 - BG: +(359) 88-662-8148