Показать сообщение отдельно
Старый 26.08.2005, 15:37     # 2
ac2on
Junior Member
 
Регистрация: 28.07.2005
Адрес: Ставрополь
Сообщения: 90

ac2on Известность не заставит себя ждать
Вот лови...
Хотя если бы ты минуту удилил бы яндексу, тебе бы не пришлось сюда писать
<?
/*****************************
Jik All rights reserved.
This is a standard copyright header for all source
code appearing at Jik.
This application/class/script may be redistributed,
as long as the above copyright remains intact.
Comments to jik@mail.ru
*******************************
check new to <a href="http://jiks.chat.ru" target="_blank">http://jiks.chat.ru</a>

*/

/**
* @title Sock Sender
* @author Jik
* @version 0.1 - first version. Supported only POST method
*/

/*
it's class allow send any POST http query to any server and get answer.
Use for send from script (and cron) any posts to
any servers: icq, sms, boards, and other.

Open html source code from server, mark a
"input" tags, values, write $data array and send it!
*/

class socksender
{
var $User_Agent="Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)";
var $Accept_Encoding="gzip, deflate";
var $method="POST";
var $protocol="HTTP/1.0";
var $send2port=80;

function send($host, $send2url, $referer, $data)
{
$http_query="";
while (list($name,$value)=each($data))
{
$tmp_data[]=urlencode($name)."=".urlencode($value);
}
$enc_data=implode("&", $tmp_data);
$len_data=strlen($enc_data);
if ($this->method=="POST")
{
$http_query=
$this->method." ".$send2url." HTTP/1.0\r\n".
"Referer: ".$referer."\r\n".
"Content-Type: application/x-www-form-urlencoded"."\r\n".
"Content-Length: ".$len_data."\r\n".
"Host: ".$host."\r\n".
"Accept: */*\r\n".
"Accept-Encoding: ".$this->Accept_Encoding."\r\n".
"Connection: Keep-Alive"."\r\n".
"User-Agent: ".$this->User_Agent."\r\n"."\r\n".
$enc_data;
flush();
$fs = fsockopen($host, $this->send2port, &$errno, &$errstr, 30);
if (!$fs) { die ("unable open socket: $errstr ($errno)");}
fputs ($fs, $http_query);
while($r=fgets ($fs, 20048)) $rt.=$r;
fclose($fs);
flush();
}
return $rt;
}
}

$post=new socksender();

$data['to']="#нужный UIN";
$data['from']="Имя Юзера";
$data['fromemail']="info@домен.ру";
$data['body']="TEST MESSAGE";

echo "<pre>".$post->send("web.icq.com",
"/whitepages/page_me/1,,,00.html",
"http://web.icq.com/wwp?Uin=#нужный UIN",
$data)."</pre>";
?>

Все взято от сюда
_http://phpclub.ru/talk/showthread.php?threadid=16161&perpage=20&pagenumber=1

Вот еще посмотри сдесь
_http://helper10.narod.ru/icq0.htm

Вот еще как вариант
<?

flush();

// поля надо заполнить
$from='Dmitry Borodin';
$fromemail='ваше_мыло@php.spb.ru';
$subject='сабж';
$to='00000000'; // <-- номер. (Уверен, что кто-нить не догадается :-)
$body='само сообщение';

$submit='Send Message'; // don't edit
$ref="http://wwp.icq.com/148546"; // don't edit


// формирование заголовка
$PostData=
"from=".urlencode($from)."&".
"fromemail=".urlencode($frommail)."&".
"subject=".urlencode($subject)."&".
"body=".urlencode($body)."&".
"to=".urlencode($to)."&".
"submit=".urlencode($submit);

$len=strlen($PostData);

$nn="\r\n";
$zapros=
"POST /scripts/WWPMsg.dll HTTP/1.0".$nn.
"Referer: $ref".$nn.
"Content-Type: application/x-www-form-urlencoded".$nn.
"Content-Length: $len".$nn.
"Host: wwp.icq.com".$nn.
"Accept: */*".$nn.
"Accept-Encoding: gzip, deflate".$nn.
"Connection: Keep-Alive".$nn.
"User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)".$nn.
"".$nn.
"$PostData";

echo $zapros."\n\n-------------\n\n\n";
flush();

// открываем сокет и шлем заголовок
$fp = fsockopen("wwp.icq.com", 80, &$errno, &$errstr, 30);
if(!$fp) { print "$errstr ($errno)\n"; exit; }


// для наглядности выводим заголовок ответа и страницу на экран
fputs($fp,$zapros);
print fgets($fp,20048);
fclose($fp);

?>
ac2on вне форума