kaancho12
Technical User
- Feb 22, 2005
- 191
hi,
could anybody tell me the way to "POST" a file using "HTTP header" after authentication??? Here's what I have as of now, but its not working. Is this the way to send out HTTP header with POST ???:
$fp = fsockopen("192.168.0.141", 80, $errno, $errstr);
if (!$fp){
echo "ERROR:" . $errno . "-" . $errstr . "<br>";
}else{
$out = "POST /cgi-bin/ss/program.cgi?client=1&dbname=products&filename=\"/var/ HTTP /1.1\r\n";
$out .= "HOST: 192.168.0.141\r\n";
$out .= "Authorization: Basic ".base64_encode("username
asswd")."\r\n\r\n";
$string = "";
while(!feof($fp)){
$string .= fgets($fp, 128);
echo "string: " . $string;
}
fclose($fp);
could anybody tell me the way to "POST" a file using "HTTP header" after authentication??? Here's what I have as of now, but its not working. Is this the way to send out HTTP header with POST ???:
$fp = fsockopen("192.168.0.141", 80, $errno, $errstr);
if (!$fp){
echo "ERROR:" . $errno . "-" . $errstr . "<br>";
}else{
$out = "POST /cgi-bin/ss/program.cgi?client=1&dbname=products&filename=\"/var/ HTTP /1.1\r\n";
$out .= "HOST: 192.168.0.141\r\n";
$out .= "Authorization: Basic ".base64_encode("username
$string = "";
while(!feof($fp)){
$string .= fgets($fp, 128);
echo "string: " . $string;
}
fclose($fp);