Php uses ICQ gateway to send text message _ PHP Tutorial

Source: Internet
Author: User
Php uses the ICQ gateway to send text messages. The following code copies the php source code that sends a text message via the ICQ Gateway :? ######################################## ################## ForquestionsandcommentsRola php source code for sending text messages through the ICQ Gateway

The code is as follows:


//###################################### #####################
//
// For questions and comments
// Roland (alias-=: Vlieg: = -)
// Icq #78354631.
// Mail: vlieg@atoomnet.net
//
// NB: This script won't work on free hosting pages, because of the secure mode!
// NB: You must have registered your ICQ # at http://web.icq.com/sms/login/ in order for this script to work
//###################################### #####################

//************************************** * ************************* \/Config:
$ Uin = ""; // your ICQ number
$ Passw = ""; // your ICQpassWord
$ PRefix = ""; // sms prefix
$ Phonenumber = ""; // sms phone number
$ Message = "Hello! "; // Sms message

//************************************** * ************************* \/EN: calculate the content length
$ Contentlength = (37 +
Strlen ($ uin) +
Strlen ($ passw)
);
//************************************** * ************************ \ // Openen van de inlogpagina
// EN: open loginpage
$ Htmlreply = "";
$ Post = "POST http://web.icq.com/karma/dologin/1,,,00.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd. ms-Powerpoint, application/vnd. ms-Excel, application/msword ,*/*
Referer: http://web.icq.com/sms/login/1,,,00.html
Accept-Language: nl
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: web.icq.com
Content-Length: ". $ contentlength ."
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: uin = ". $ uin. "; sms_country = ". $ prefix. "; KarmaService1 = Yes; uin = ". $ uin. "; sms_country = ". $ prefix. "; KarmaService1 = Yes
UService = 1 & uLogin = ". $ uin." & uPassword = ". $ passw." & x = 0 & y = 0 ";
$ Remote = fsockopen ("web.icq.com", 80, & $ errno, & $ errstr, 30 );
Global $ remote;
Global $ post;
Fputs ($ remote, $ post );
While (! Feof ($ remote) {$ htmlreply. = fgets ($ remote, 120 );}
// Uncomment for output: echo "". htmlspecialchars ($ htmlreply )."";
Fclose ($ remote );
//************************************** * ************************ \ // Persoonlijke cookie uit de inlogpage halen
// EN: fetch personal cookie from login page
$ Splited = split ("\ n", $ htmlreply );
$ Cookies = $ splited [3];
$ Cookies = str_replace ("Set-Cookie: KarmaLogin =", "", $ cookies );
$ Cookies = str_replace ("; path =/", "", $ cookies );
$ Cookies = str_replace ("\ n", "", $ cookies );
// Uncomment voor output: echo $ cookies;
If (strlen ($ prefix) = 2) {$ contentprefix = ''. $ prefix;} else {$ contentprefix = $ prefix ;}
$ Charcount = (160-strlen ($ message ));
$ Contentlength = (1561 +
Strlen ($ message) +
Strlen ($ charcount) +
Strlen ($ phonenumber) +
Strlen ($ prefix)
);
//************************************** * ************************ \ // Verzendpagina openen met de opgehaalde cookie
// EN: open send page with fetched cookie
$ Htmlreply = "";
$ Post = 'post http://web.icq.com/sms/send_history/1,,,00.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd. ms-powerpoint, application/vnd. ms-excel, application/msword ,*/*
Referer: http://web.icq.com/sms/send_session/1,,,00.html? Prefix = + '. $ prefix.' & carrier = & tophone = '. $ phonenumber .'
Accept-Language: nl
Content-Type: multipart/form-data; boundary = --------------------------- 7d12442eab4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: web.icq.com
Content-Length: '. $ contentlength .'
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: uin = '. $ uin. '; sms_country = '. $ prefix. '; KarmaService1 = Yes; KarmaLogin = '. $ cookies. '; uin = '. $ uin. '; sms_country = '. $ prefix. '; KarmaService1 = Yes; KarmaLogin = '. $ cookies.'
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "carrier"

----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "prefix"
'. $ Contentprefix .'
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "tophone"
'. $ Phonenumber .'
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uSession"
1
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uReply"

----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uLastId"

----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uSend"
1
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uNextId"

----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uHistoryCounter"
1
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "count"
0
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "uSubmitCount"
0
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "checkNewMsg"
180000
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "charcount"
'. $ Charcount .'
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "msg"
'. $ Message .'
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "x"
30
----------------------------- 7d12442eab4
Content-Disposition: form-data; name = "y"
16
----------------------------- 7d12442eab4 --
';
$ Remote = fsockopen ("web.icq.com", 80, & $ errno, & $ errstr, 30 );
Global $ remote;
Global $ post;
Fputs ($ remote, $ post );
While (! Feof ($ remote) {$ htmlreply. = fgets ($ remote, 120 );}
// Uncomment for output: echo "". htmlspecialchars ($ htmlreply )."";
Fclose ($ remote );
//************************************** * ************************ \ // Check if message is send if send 'moved permanently' is returned
If (eregi ('moved Permanently ', $ htmlreply ))
{Echo "Sms message successfully sent! ";}
Else
{Echo "Sms not sent! ";}
?>

The pipeline code is as follows :? //###################################### #################### // For questions and comments // Rola...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.