17th Dec ’10 :
Now here’s the deal. 160by2,way2sms and freesms8 offer free SMS and earn money through the ads on their website. By using this PHP script, we are bypassing their website illegally as their ad never gets shown. I hope you will keep this in mind when you use this script. If you want to send free SMS legally, then head over to http://freesmsapi.com and create an account. They are offering an excellent service totally free of cost.
Also the developers at way2sms and freesms8 keep changing their url’s and security methods to prevent such scripts from working (160by2.com guys are cool about this). And as this PHP code published here can be viewed publicly, their jobs become easy. So I will not be able to continue development of the scripts because as soon as I publish the code here, way2sms/freesms8 change their code to break my code.
So there should be a way to restrict access to the PHP code published here so that the code reaches appropriate hands only. Maybe a password protected SVN or forums based on reputation points, I dont know..
Post in your opinions about this as a comment and lets see whether we can work it out together.
Update as of 5th Oct ’10 : Bulk SMS services restored !!
Update as of 24th Sep ’10 : Govt has banned bulk sms temporarily. So all the bulk sms providers have stopped their services. More info. This script will not work till Sep 29th. In the meantime, I will upload the next version of the script which can check internet connectivity, login errors and other responses sent by the gateway. I will also be adding support for freesmsapi.com and freesms8.com gateways.
Update as of 10th Sep ’10: The code has been updated to accomodate a small change in the way2sms website.
Update as of 15th Aug ’10 : The code has been updated to work on all 160by2 and way2sms accounts and also will fetch any error codes being generated by these gateways. If you encounter any bugs, drop in a comment.
This is a PHP script I wrote a while back to automate the sending of SMS/text message using 160by2.com/way2sms.com account.
You can use this PHP API script to send free sms India, Kuwait, Singapore, UAE, Phillipines, Malaysia etc. Very useful if you are combining this with the registration page of your website to verify the users mobile number similar to verification of their email address.
Some possible real world applications of this script are :
1. Email to SMS.
2. Birthday alerts/Daily joke/thought for the day/news SMS
3. Gtalk/XMPP to SMS
Pre-requisites to use this script :
1.You need a hosting server with PHP5 and cURL extension enabled. The server should be able to open socket connections to other servers.
2.a valid,verified 160by2.com account or way2sms.com account (Create an account for free on one of these gateways and send a test SMS through their UI first.)
Example Usage (Also included in example.php):
include_once “class.curl.php”;
include_once “class.sms.php”;$smsapp=new sms();
$smsapp->setGateway(‘way2sms’); // you can set gateway to be 160by2 to use your 160by2 account;
// way2sms code has been tested on different accounts to be stable.echo “Logging in … “;
$smsapp->login(‘username for way2sms’,'password’);echo “Sending SMS … “;
$result=$smsapp->send(’10 digit mobile number’,'Your text message’);if($result)
{
echo “Message sent”;
}
else
{
echo “Error encountered : “.$smsapp->getLastError();
}
Limitations :
1. 160by2.com offers a character limit of around 145 for each message. Way2sms offers a character limit of 140 characters per message. Please see that the character limit is honored.
2. also a limit of 50 messages per day per account and 10 messages per recepient phone number holds good for 160by2.
(27503 hits) SMS API Download |
Demo:
Click here for a simple demo application to send free SMS using this API
I had also written a script using this class to send an sms alert to notify as soon as the booking for an upcoming movie opens up on bookmyshow.com, if someones interested in using this bookmyshow script, drop in a comment.
New SMS API
Supports 160by2, freesmsapi, freesms8. Does not support way2sms as of now.
To send free SMS all over the world using your iPhone/iPod touch, use Textoo Pro app. It is currently the best iphone app to send free unlimited text messages easily.
(13693 hits) PHP SMS API v2.0 Download |
Thank you very much. the codes are working successfully sent sms…. again thank you very much man, keep it work
Hello Kiran (Admin) it would be thankful to you if u help me on using this api in Vb.net or Visual Basic , How can i use the Api in These languages ?
Someone else had asked a similar question through comments sometime back. Please refer to my reply. The comment should be in the first few pages.
Hi Kiran
Im getting this error when using 160by2.com
Logging in … Sending SMS … Error encountered : Invalid Contact or Group Name 10digitnumber1,98951xxxxx
Hi Kiran
Im getting this error when using 160by2.com
Logging in … Sending SMS … Error encountered : Invalid Contact or Group Name 10digitnumber1,98564xxxxx
Make the changes in example.php to include the actual mobile numbers. i.e. replace 10digitnumber1 with your own number.
i dont know how to use it!!!
could u explain the procedure ?
i want to include it in my site.
so please help me!!!
The procedure is clearly explained in the blog post.
I tried the code but its not working …
kindly response me to send the message using PHP script only.
Can you post the exact error message ? Also refer to some of the old comments. Either curl is not enabled, or you might need a proxy.
hey admin plz help me i am getting error …. Logging in … Login error :Username not specified. but i have done everything….so now????
Please mention the gateway you are using. Also cross check whether you have enterered your username and password for that gateway in example.php
Warning: include_once(class.curl.php) [function.include-once]: failed to open stream: No such file or directory in E:\xampp\htdocs\trial5.php on line 2
Warning: include_once() [function.include]: Failed opening ‘class.curl.php’ for inclusion (include_path=’.;E:\xampp\php\PEAR’) in E:\xampp\htdocs\trial5.php on line 2
Warning: include_once(class.sms.php) [function.include-once]: failed to open stream: No such file or directory in E:\xampp\htdocs\trial5.php on line 3
Warning: include_once() [function.include]: Failed opening ‘class.sms.php’ for inclusion (include_path=’.;E:\xampp\php\PEAR’) in E:\xampp\htdocs\trial5.php on line 3
Fatal error: Class ‘sms’ not found in E:\xampp\htdocs\trial5.php on line 5
Extract all the files in the downloaded zip to a directory. Ensure that the file example.php exists along with class.sms.php class.curl.php etc in the direcotry you have extracted. All the files should be uploaded to your web host or should be present in your local apache directory.
i used ur source. it’s working well.Thanks lot.
Any Vb script available for send sms
I dont think there is a direct VB script to do this. But you can modify the example.php to read $_POST or $_GET variables so that you can call a single URL from VB script to send SMS.
Bulk sms code is not working.. Always coming as error encountered.. Tried with 160by2 and also with freesms8.com
Can u help me..!
Bulk sms code is not working.. Always coming as error encountered.. Tried with 160by2 and also with freesms8.com
Can u help me..!
please tell me where was the login form
I am executing in WAMP server., Previous way2sms single messagin api is workng well. but bulk sms api’s are not working out..;-(
Not working !!!!
Not working at all I tried everything even tried to find out the bug in it but dnt knw wht happened to it…….
Not working at all I tried everything even tried to find out the bug in it but dnt knw wht happened to it…….
Guys. my older bug was fixed, now sms is going from freesms api. but., i cant change the sender id from api. can any one help me?
the following error occurs :
Warning: fopen(cookie1295172415.txt) [function.fopen]: failed to open stream: Permission denied in /home/vhosts/parth.xp3.biz/class.curl.php on line 42
Free Web Hosting
how to use this script to add this sms sending for freesmsapi
in blogger.com account
i mean how to add this in a blog.
only freesmsapi is important for me
160by2 and way2sms are optional
please help me out …..
please…
hi… i hav developed an api for use by everyone.. check it out at http://ubaid.tk/sms/
you can use the web page created by me, or u can use the api structure.. for example, your application can directly fwd the request to
http://ubaid.tk/sms/sms.aspx?uid=99999xxxxx&pwd=12345&msg=sms text which u want 2 send&phone=9996669990&provider=way2sms
the differen providers are way2sms, fullonsms, smsinside and tezsms..
works 100%, all the time..
cheers..
dude you are awesome..i struggled so much to develop and api for the same and you already have one.. you are simply great dude.can you mail me how did you login into the way2sms using aspx..
The above code is working for one day only in 160by2. The next day it stops in login error though the username and password are correct. Give me a solution to this.
now we r in design of attendance_alert for my college
it’s very useful for our work
it’s super in working
now we r in design of attendance_alert for my college
it’s very useful for our work
it’s super in working
hii,i’m getting error while sending message.i also tried your given php api it is also giving error.
please provide the code for the bookmyshow…
Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that Service.
Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that SMS API Application.
Hii.. i am having website for love quotes.. here i would like to provide free sms service (like 160by2.com & way2sms.com)to my visiters from my website. is it possible for me and please guide me about that SMS API Application.
Curl is enabled and m trying to use 160by2..made all the reqd changes in example.php but it doesnt work. Please help me i really need this piece of code..!!!
Logging in …
Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS-API\class.sms.php on line 128
Sending SMS …
Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS-API\class.sms.php on line 149
Error encountered :
Although my username password combination enterd is right fr 160by2 i get the foll
Logging in … Login error :
what do i do?
When i try the code fr freesms8_com this is what i get..m stuck nw..what to do..plz rep asap..!
Logging in … Sending SMS … Error encountered
for freesms8_com this is what i get m stuck plz help asap..!
Logging in … Sending SMS … Error encountered
it’s not workding
this below error is showing in my local server
Logging in …
( ! ) Fatal error: Call to undefined function curl_init() in C:\wamp\www\api\class.curl.php on line 59
Call Stack
# Time Memory Function Location
1 0.0006 368344 {main}( ) ..\example.php:0
2 0.0029 476312 sms->login( ) ..\example.php:16
3 0.0029 476616 call_user_func ( ) ..\class.sms.php:45
4 0.0029 476632 sms->login_way2sms( ) ..\class.sms.php:0
5 0.0029 476744 cURL->post( ) ..\class.sms.php:62
Deal! Accepted.
Script to bookmyshow. How you execute script continuously. Crond?
Hi, this is vishal here.
I have used your sms script but it doesn’t work, i also checked way2sms demo but it doesnot work steel got msg like ERROR ENCOUNTERED: so could u help me.
Vishal
Logging in … Sending SMS … Error encountered :
I got this type of output with “Error encoutered” message
And i have used “freesms8_com” gateway
plese can any one help me?
Hi Kiran,
am getting an “Error Encountered…” how to fix this, pl pl pl help me
with regards,
Sandeep M
160by2 php code changed in previous week, please give instruction – how i create curl script for new chage, please …
160by2 php code changed in previous week, please give instruction – how i create curl script for new chage, please …
Hi Kiran,
Thanks a lot this code working for me.
Keep it Up.
Hi Kiran,
Thanks a lot this code working for me.
Keep it Up.
asdf
Pingback: press release submission
demo not working please give working demo otherwise remove it
Hi,
I got the error in curl_init() function..
wat is the reason behind that??
shyam
u need to enabled curl in ur php settings(i hope)
and kiran the code is not working bro hope they have changed the url from
http://www.way2sms.com
to
http://site3.way2sms.com/content/index.html
hope i think may be thats problem is can u check and say me
du any one have ideas about some php codes that communicates with cellphone towers
kiran yaar undefine offset:1 ka nitice aa rahaa hai
Hi,kiran sir.way2sms has changed thier site settings and layout.so your sms script is not working.please fix it or help me to fix it.contact me on my email [email protected]
Please Help Your Code not work
my Email Id [email protected]
I have working sms script using way2sms-Alfasms API !
You can get it from http://www.http://alfredfrancis.in/alfasms-api.
It works with New way2sms layout and supports PHP,PERL,PYTHON,C,C++,VB.NET,VB etc !!!! try now !!!