<?
$login['karma
successurl'] = "http://web.icq.com/sms/inbox/?";
$login['karma
failurl'] = "/login/login
page?karmaproduct
css=icq2go&karmasuccess
url=http%3A%2F%2Fweb%2Eicq%2Ecom%2Fsms%2Finbox%2F%3F&karmaforget=&karma
service=";
$login['karmaservice'] = "";
$login['karma
userlogin'] = "111111111"; // your icq number
$login['karma
userpasswd'] = "password"; // your icq password
$login['karma_remember'] = "1";
/ build request string for login /
foreach ($login as $key=>$val)
$requestarray[] = "$key=$val";
$loginrequest = "?".implode($request_array, "&");
// the following details are for mobile number - +44 (0)7968 330292
$sms['country'] = "44"; // the receivers country code
$sms['prefix'] = "+44"; // the receivers country code with + prefix
$sms['carrier'] = "7968"; // the receivers mobile network number
$sms['tophone'] = "330292"; // the receivers mobile number
$sms['uSend'] = "1";
$sms['msg'] = "this is a test message"; // the message to be sent
$sms['charcount'] = (160 - strlen($sms['msg'])); // 160 - length of the message
/ build request string for sending sms /
foreach ($sms as $key=>$val) {
$smsrequest .= "--6G+f\n"
."Content-Disposition: form-data; name=\"".$key."\"\n\n"
.$val."\n";
}
$smsrequest .= "--6G+f\n";
// log user in and get cookies for later use.
$fp = fsockopen("web.icq.com", 80);
fputs($fp, "POST http://web.icq.com/newlogin/1,,,00.html HTTP/1.0\n");
fputs($fp, "Referer: http://web.icq.com/login/loginpage/?karmaproductcss=icq2go&karmaforget=&karmaservice=&karmasuccessurl=http%3A%2F%2Fweb%2Eicq%2Ecom%2Fsms%2Finbox%2F%3F\n");
fputs($fp, "Connection: close\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-Length: ".strlen($loginrequest)."\n\n");
fputs($fp, $login_request);
while (!feof($fp)) {
$return = fgets($fp, 1024);
// we only want cookies with data in them.
if (stristr($return, "cookie") && !eregi("karma2_[a-z]+\=\;",$return)) {
$cookies[] = "Cookie".trim(stristr($return, ":"))."\n";
}
}
fclose($fp);
// open sms form page and get the cookie which is set on that page
$fp = fsockopen("web.icq.com", 80);
fputs($fp, "GET http://web.icq.com/sms/inbox/? HTTP/1.0\n");
foreach ($cookies as $key=>$val) {
fputs($fp, $val);
}
fputs($fp, "Connection: close\n\n");
while (!feof($fp)) {
$return = fgets($fp, 1024);
// we only want cookies with data in them.
if (stristr($return, "set-cookie:") && !eregi("karma2_[a-z]+\=\;",$return)) {
$cookies[] = "Cookie".trim(stristr($return, ":"))."\n";
}
}
fclose($fp);
// set the cookies that are set by javascript when the form is sent.
$cookies[] = "Cookie: noalert=false;expires=Saturday, 06-Sep-2014 23:50:08 GMT;path=/;domain=.icq.com;\n";
$cookies[] = "Cookie: smscountry=".$sms['country'].";expires=Saturday, 06-Sep-2014 23:50:08 GMT;path=/;domain=.icq.com;\n";
// send the data to the sms processing script.
$fp = fsockopen("web.icq.com", 80);
fputs($fp, "POST http://web.icq.com/sms/sendmsgtx/1,,,00.html HTTP/1.0\n");
foreach ($cookies as $key=>$val) {
fputs($fp, $val);
}
fputs($fp, "Connection: close\n\n");
fputs($fp, "Content-Type: multipart/form-data; boundary='6G+f'\n\n");
fputs($fp, "Content-Length: ".strlen($smsrequest)."\n\n");
fputs($fp, $smsrequest);
while (!feof($fp)) {
$return = fgets($fp, 1024);
echo $return."<BR>";
}
fclose($fp);
?>
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).