halojoy:
Thank you very much for your reply.
I apologize. I was too lazy to provide enough info for this.
Well I never try to reinvent the wheel.
I successfully used for years the following function I found at
http://www.nukedweb.com/ (see below)
<?
####################################
WebPost
From NukedWeb
####################################
#
#WebPost is a very simple include script to show you how to send data to a website
#using the HTTP POST method. The most important part of this script is the fact that
#the User-Agent and Referer headers are set, to make the script you're connecting to
#think this script was connected to by a real web browser.
#
#Just include this script in your own script, and use the function with the example below:
#
include "./webpost.php";
$data = post("www.nukedweb.com", "80", "/script.php", "a=1&b=2&c=3");
(the script returns HTTP output from the remote server, including HTTP headers)
#Note: I've noticed many people download this script but never keep it. If this script
isn't quite what you were looking for, please email me and let me know exactly what
#it is you needed! Chances are I'll create what you need (without charge). 🙂
#tim@nukedweb.com
function post($host, $port, $uri, $postdata){
$fp = fsockopen($host,$port);
if ($fp){
$contlen = strlen($postdata);
$output = "POST $uri HTTP/1.1\nReferer: http://".$host.$uri."\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, /\nAccept-Language: en-us\nContent-Type: application/x-www-form-urlencoded\nAccept-Encoding: gzip, deflate\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\nHost: $host\nContent-Length: $contlen\nConnection: Keep-Alive\n\n$postdata\n\n";
fputs($fp, "$output\r\n");
$string="";
while(!feof($fp) && $fp){
$string.= fgets($fp,128);
}
fclose($fp);
}
return $string;
}
?>
What I know for sure is that I have to solve the authentication problem first and
than I can use NukedWeb’s Post function.
What I did next was to use Microsoft Network Monitor to see what the browser is
sending to the server.
There are two hidden variables received from the server, the value of the two
variables are changing with every page download and this is easy to get but
what I found next was a long string that is starting with “Authorization:
Negotiate”.
So now that I know what the browser is sending to the server I can use post
function from nukedweb.com but what I don’t know is how to do the
authentication and what I need to know to create the “Authorization: Negotiate”
string.