Hi Guys,
I want to post into a form using https, or secure connection. Any body know?
I know how to do post method using a http connection. it is using the fsockopen. This is working. I've been trying this, but it doesn't work for secure https.
Any body know?
This I copy and paste the tecnique of posting into http so somebody can find as well.
FORM POST METHOD SECURE
// Data to pass to the cgi script
$name = 'John Doe';
$email = 'johndoe@domain.com';
$msg = 'Nice site, I love your animated gif collection!';
// Build the request string
$request = 'name=' . urlencode($name);
$request .= '&email=' . urlencode($email);
$request .= '&msg=' . urlencode($msg);
// Build the header
$header = "POST /guestbook/add.php3 HTTP/1.0\r\n";
$header .= "Content-type:
application/x-www-form-urlencoded\r\n";
$header .= "Content-length: " . strlen($request) .
"\r\n\r\n";
// Open the connection
$fp = fsockopen('www.domain.com', 80, &$err_num, &$err_msg, 30);
if ($fp)
{
// Send everything
fputs($fp, $header . $request);
// Get the response
while (!feof($fp))
$response .= fgets($fp, 128);
}
</PRE>