Here is the code:
PHP Code:
$headers = "POST /abc/add.aspx HTTP/1.1\r\n";
$headers .= "Host: mysite.com\r\n";
$headers .= "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0\r\n";
$headers .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
$headers .= "Accept-Language: en-US,en;q=0.5\r\n";
$headers .= "Accept-Encoding: gzip, deflate\r\n";
$headers .= "Connection: keep-alive\r\n";
$headers .= "Referer: https://www.mysite.com/abc/add.aspx\r\n";
$headers .= "Cookie: ASP.NET_SessionId=$ASPSESS\r\n";
$headers .= "Content-Type: multipart/form-data; boundry=".$d.$boundary."\r\n";
$headers .= "Content-Length: $bodyLength\r\n";
$headers .= "POSTDATA: $bodyString";
$fp = fsockopen("ssl://www.mysite.com", 443, $errno, $errstr);
if ($fp)
{
fwrite($fp, $headers);
$response = '';
while (!feof($fp))
$response .= fgets($fp);
fclose($fp);
}
Bookmarks