• #1 written by karnna
    about 13 years ago

    waiting for demo….

  • #2 written by admin
    about 13 years ago

    demo uploaded. Source code for demo will be rolled out soon.

  • #3 written by harmeet
    about 13 years ago

    Logging in … Sending SMS …
    Notice: Undefined offset: 1 in D:\Hosting\4907009\html\allsites\pz10\sms\class.sms.php on line 88

    Notice: Undefined offset: 1 in D:\Hosting\4907009\html\allsites\pz10\sms\class.sms.php on line 93
    Error encountered :

    please help in how it works

  • #4 written by harmeet
    about 13 years ago

    please tell me where was the login form

  • #5 written by Salan Khalkho
    about 13 years ago

    I just tested the demo and it worked fine for me. I still need to test the code on my server.

    Great work. But it can be the best work if the page takes the person to thank you page instead of keeping him on smsdemo page.

    Thanks
    Salan

    • #6 written by admin
      about 13 years ago

      You can change the action attribute for the form to send the user to a new page after the SMS is sent. Right now its in the same page to keep things simple.

  • #7 written by rajkumar
    about 13 years ago

    I am getting the following error.

    Logging in …
    Fatal error: Call to undefined function curl_init() in E:\UCan\www\sms-api\class.curl.php on line 48

    • #8 written by admin
      about 13 years ago

      You will need to enable cURL extension in the PHP.ini file. You will find a lot of tutorials on how to do this. Some good hosting companies enable this by default.

  • #9 written by Srikanth Gupta
    about 13 years ago

    Nice SMS API…Good Stuff

  • #10 written by Anees
    about 13 years ago

    Nice thanx a lot for this

  • #11 written by Smarth
    about 13 years ago

    Undefined offset: 1 in C:\wamp\www\SMS\class.sms.php on line 60

    Please help

    • #12 written by admin
      about 13 years ago

      Can you confirm that cURL is enabled and also that you dont need a proxy to connect to the internet ?

  • #13 written by Sumit Joshi
    about 13 years ago

    Dear Kiran,
    I want to get contact list from Yahoo, Gmail, MSN from PHP code. My current project needs that facility. So please help me out.

    Thank you for your help.

    • #14 written by admin
      about 13 years ago

      Hi, Sumit,
      It is not very easy to import contact lists from all the providers as they do not provide any API to do this. Although there are a couple of scripts (nonfree) which use cURL to fetch the contacts.
      You should try out those

  • #15 written by mythili
    about 13 years ago

    i uploaded the code and i’m getting error as

    Logging in … Sending SMS …
    Notice: Undefined offset: 1 in xxxxx\class.sms.php on line 88

    Notice: Undefined offset: 1 in xxxxx\class.sms.php on line 93
    Error encountered :

  • #16 written by Anees
    about 13 years ago

    Today no message from demo and my site Is service stop by 160by2

    • #17 written by admin
      about 13 years ago

      Please check the demo now.

  • #18 written by muhammad samee
    about 13 years ago

    i want to use smsroaming api (http://smsroaming.com)
    frommy website kindly you adujest this api in this scrpit and email me i will b greatfull to you
    [email protected]

  • #19 written by amit k
    about 13 years ago

    not working…sorry

  • #20 written by Sanjay
    about 13 years ago

    Hi Kiren,
    Its great article. i have been tried with my project and encounter a one problem.

    it will give me array like this

    Logging in …
    Notice: Undefined offset: 1 in class.sms.php on line 131
    Sending SMS …
    Notice: Undefined offset: 1 in class.sms.php on line 153

    sms Object
    (
    [username] =>
    [password] =>
    [curl] => cURL Object
    (
    [headers] => Array
    (
    [0] => Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [1] => Connection: Keep-Alive
    [2] => Content-type: application/x-www-form-urlencoded;charset=UTF-8
    [3] => Accept-Language: en-us,en;q=0.5
    [4] => Accept-Encoding gzip,deflate
    [5] => Keep-Alive: 300
    [6] => Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    )

    [user_agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11 (.NET CLR 3.5.30729)
    [compression] => gzip
    [cookie_file] => cookies.txt
    [proxy] =>
    [cookies] => 1
    )

    [server] => 160by2
    [loginDone] => 1
    [debugMode] => 1
    [data] => Array
    (
    [id] =>
    )

    [error] =>
    )

    thanks in advance

  • #21 written by Afsal
    about 13 years ago

    Thanks a lot.. :)

    I have tried it in 0fees.net free host and was working perfectly.
    But now when i switched to x10hosting.com I encountered some errors. cURL is supported in x10hosting but still this error popped up.

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/….

    In x10hosting forums I found this piece of info :
    ” It is been that it is disabled on free hosting for obvious reasons.
    If you need to redirect, simply use header(“Location: ./folder/location.php”); ”

    Can you pls modify the code in such a way that it won’t use the CURLOPT_FOLLOWLOCATION?

    Thanks once again.. :)

    • #22 written by admin
      about 13 years ago

      Hey Afsal,
      Please move onto some paid hosting, Most of the free hosting websites which give full privileges are being misused, hence they block network related PHP functions.
      You could modify line 53 and 70 in class.curl.php to ‘curl_setopt($process, CURLOPT_FOLLOWLOCATION, 0);’ and give it a try. I think this change should work without problems.

      • #23 written by Afsal
        about 13 years ago

        I tried it after modifying as you said. But its not working. I guess i will have to move to paid hosting.

  • #24 written by leo
    about 13 years ago

    Hey Afsal .. without curl you cannot run this script. But you can use byethost.com has a free host.

    • #25 written by Afsal
      about 13 years ago

      Yeah I know that it requires cURL but the byethost free hosting account doesn’t support cURL. But its paid hosting is supporting it.

  • #26 written by admin
    about 13 years ago

    Hey all, Sorry for the delay. Now the code is working on both way2sms and 160by2 accounts.

    • #27 written by Saswata
      about 11 years ago

      Thanks for this, but it is showing this following error:

      Logging in …
      Notice: Undefined offset: 1 in /home/public_html/sms/class.sms.php on line 73
      Sending SMS …
      Notice: Undefined offset: 1 in /home/public_html/sms/class.sms.php on line 93

      Notice: Undefined offset: 1 in /home/public_html/sms/class.sms.php on line 98
      Error encountered :

  • #28 written by R Goyal
    about 13 years ago

    Hello Kiran,
    Thanks for providing the code.
    As i am new to PHP,ca you plz help me in setting up the app at my system?

    You need a hosting server with PHP5 and cURL extension enabled. The server should be able to open socket connections to other servers

  • #29 written by admin
    about 13 years ago

    Are you testing it on a local server ?
    {
    If yes, are you using windows ?
    {
    Download xampp/wamp and install it. Search for php.ini in the installed directory and open it. Search for the line which says php_curl.dll and remove the semi colon (;) character from the beginning of the line. This will enable cURL on your system. Then put in your scripts to the htdocs folder in the xampp/wamp directory. And then access the example.php file through the browser (http://localhost/example.php)
    }
    If you are using linux{
    You can get lampp for linux from the xampp website and follow the same procedure as above
    }
    }

    Are you testing it on a hosting server {
    Most paid hosting servers have cURL enabled if PHP is enabled. So just upload all the php scripts onto a dir on the server using FTP and modify the example.php to put in the username,password. Run the script through your browser.
    }

  • #30 written by Dnz
    about 13 years ago

    Thanks for the code. A brilliant mind you got there but when I run your code to my localhost I got the following error:

    Logging in …
    Fatal error: Call to undefined function curl_init() in C:\wamp\www\new1\sms-api\class.curl.php on line 59

    Can you help me how to fix this one?
    Thanks and hoping for your response…

    • #31 written by admin
      about 13 years ago

      Hi Dnz, please enable cURL in PHP. Refer other comments for info on how to do it.

  • #32 written by Bazinga
    about 13 years ago

    The demo doesn’t seem to be working.

    • #33 written by admin
      about 13 years ago

      Hi, Bazinga, I just tested the demo, and it is working.

      • #34 written by Bazinga
        about 13 years ago

        Well, it didn’t work for me. I received no message. Although it works PERFECTLY on a server. Thanks a lot. :D

  • #35 written by harmeet
    about 13 years ago

    i uploaded the code and i’m getting error as

    Logging in … Sending SMS …
    Notice: Undefined offset: 1 in xxxxx\class.sms.php on line 88

    Notice: Undefined offset: 1 in xxxxx\class.sms.php on line 93
    Error encountered :
    plz help me
    i am asked u already how to recover this problem

    • #36 written by admin
      about 13 years ago

      Hi Harmeet, The new code should fix all the errors. Please re download the scripts.

  • #37 written by Aishwin
    about 13 years ago

    Hello,

    I really appreciate your script.
    What I am looking for is I would be able to take the mobile no. from the database where the user registered his no., and should throw a msg on the cell with the activation code, asking the user to enter this code on website.

    an SMS verification script used while registering on my account.

    Waiting…
    Anyone pls help on this.
    [email protected]

    • #38 written by admin
      about 13 years ago

      A quick way to do this is to take the first 5 characters of the MD5/SHA1 hash of the mobile number and send it to the user as a SMS. But this is not secure.
      So you could generate a random number and store it back into the DB and use it back for verification. This is a better way to verify the number.
      I am not sure whether there is any open source script to do this as this kind of verification is normally done only on Indian websites ;)

  • #39 written by Aniruddha
    about 13 years ago

    Hi Kiran,
    Nice work man…It works on both way2sms and 160by2..
    Cheers

    • #40 written by admin
      about 13 years ago

      Hey Ani, Thanks dude.

      • #41 written by mark
        about 10 years ago

        Hi I like to use this api on other gateway like smscountry. as in urs api it needs to logged in with mobile no and password. But i have my user name and password and i am trying to run it with data i have but it always giving error … “Error encountered” and rest is blank.

        Thanks

  • #42 written by rahool
    about 13 years ago

    Getting error :(

    Logging in …
    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 65

    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 73
    Sending SMS …
    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 93

    Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 98
    Error encountered :

    • #43 written by admin
      about 13 years ago

      Can you verify whether you require a proxy to connect to the internet. Looks like PHP is not able to access their server.

      • #44 written by rahool
        about 13 years ago

        yes i do require proxy to connect…
        do i need to make any changes in the code?

        • #45 written by admin
          about 13 years ago

          You need to edit class.sms.php line 15 and change it to “$this->curl->setProxy(“proxy-address:port”);”

          • #46 written by rahool
            about 13 years ago

            done with the proxy part but still getting error

            Logging in … Sending SMS …
            Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 94

            Notice: Undefined offset: 1 in C:\xampp\htdocs\SMS\class.sms.php on line 99
            Error encountered :

          • #47 written by admin
            about 13 years ago

            I think it might be because of the govt ban of bulk sms (http://www.ndchronicle.com/news/Govt_extends_ban_on_bulk_SMS__MMS_till_Sep_29_1285307911/)

            BTW, which gateway are you using ?

          • #48 written by rahool
            about 13 years ago

            way2sms is giving above error…..
            160by2 is working fine result shown as ‘sms sent’…
            but sms not receiving may bcoz of the bulk sms ban

            will try it again & will update you :)

          • #49 written by admin
            about 13 years ago

            I think you should wait till Sep 29th. None of the sms gateways (including freesmsapi , freesms8) is working now. And the script is failing because of an unexpected response given by the gateway.
            In the mean time , I will update the script to v2.0 which will fetch the exact error returned by the gateway and it will also have a function for connectivity check.

  • #50 written by Mandarmani Digha
    about 13 years ago

    Fabulous !

    keep it up !

  • #51 written by Sandy
    about 13 years ago

    How to send free sms with attachments i.e. images .jpg .gif etc. or .mp3 as ring tones.
    Thanks
    Regards

    • #52 written by admin
      about 13 years ago

      Hey Sandy,
      I am not sure whether it is possible to do that through SMS. You are limited to 160 unicode characters and any data which can be represented within this limit can be sent using these free SMS gateways. But again the receiving end should also support your custom encoding.
      Nokia had come up with a way to send monophonic ringtones using this technology(480 characters), but even then, not all other manufacturers supported it.
      So if you can come up with some amazing compression method, it should be possible.
      I would rather use MMS or email to do this, BTW this script doesnt support free MMS (does any free gateway offer this ? )

  • #53 written by Sandy
    about 13 years ago

    Dear KK,
    I had uploaded your script and ran it.
    It is showing following msg
    Logging in … Sending SMS … Message sent
    but I had not received any msg from way2sms.
    I had typed My login mob no and msg to be sent to mob are same in your example.php
    What may be the reason?
    Sandy

    • #54 written by admin
      about 13 years ago

      Way2sms messages get delivered much later compared to 160by2. So you might receive the message after some time. You can try sending a message through their website instead of the script and try it first.

  • #55 written by Sandy
    about 13 years ago

    Sorry Dear KK
    Your script had successfuly shown up.
    When I ran it second time I received the msg instantly.
    Sorry to bother you,
    Just now I was reading about soap and found nusoap_client_mime client supporting MIME attachments defined at http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library
    You can research on it for attachments.
    You can download from the website http://www.aswinanand.com/2008/07/send-free-sms-web-service/

    Thanks
    Sandy

  • #56 written by Sandy
    about 13 years ago

    Dear KK,
    I have separate Form to Fill Mob.no and msg as you have in your demo above.
    What additions I have to do, How will i receive these two variable from form post html to inside example.php given by your goodself so that it automatically replaces value in line:-
    echo “Sending SMS … “;
    $result=$smsapp->send(’10 digit mobile number’,’Your text message’);
    Regards,
    Sandy

    • #57 written by admin
      about 13 years ago

      If the number field in your form has the name attribute as ‘mobile’( for e.g <input type=’text’ name=’mobile’ /> ), then you can access it as $_POST['mobile']
      So $result=$smsapp->send(’10 digit mobile number’,’Your text message’); will become
      $result=$smsapp->send($_POST['mobile'],$_POST['message']);

  • #58 written by Sandy
    about 13 years ago

    I am receiving the following error msg.

    Logging in …Sending SMS …
    Notice: Undefined offset: 1 in /sms/class.sms.php on line 98
    Error encountered :

  • #59 written by BalaVivek
    about 13 years ago

    Logging in … Sending SMS … Error encountered : asdhg65653evfd

    This is the output i am getting..
    Can any one rectify it..?

  • #60 written by Pradeep
    about 13 years ago

    It works perfectly fine.
    Thank you so much ! :)

  • #61 written by Afsal
    about 13 years ago

    Oh… So the new version is out.. awesome. :) thanks buddy.

  • #62 written by sandeep
    about 13 years ago

    how can I use this for the applications developed in microsoft technologies(for web application developed in .net)

    • #63 written by admin
      about 13 years ago

      To make use of this script from other technologies, you need to modify example.php file to make it accept all the required info (mobile no, message) as a GET variable through the URL instead of hardcoding them. This way, you can call this url from .net or java
      Dont forget to take care of security.

      • #64 written by sandeep
        about 13 years ago

        Thanx, for the information given., plz if you dont mind can u give any example URL to refer? as I m new to PHP.

        • #65 written by admin
          about 13 years ago

          Sorry,
          You will need to have basic knowledge of PHP
          So you could learn the basics of php from http://www.php.net , it will hardly take a few hours to implement what you want.
          Basically you can modify example.php included in the API to make the variables pass through the url, like $mobileno=$_GET['mobileno']
          And then you can pass it through the URL as example.php?mobileno=9xxxxxxxxx

          • #66 written by sandeep
            about 13 years ago

            Thanx for the information. I will get back to you once I have done with it

          • #67 written by bhavesh
            about 13 years ago

            sandeep did you find the way , how to send sms using microsoft application if yes then plese send me at [email protected]

          • #68 written by bhavesh
            about 13 years ago


            sandeep:

            how can I use this for the applications developed in microsoft technologies(for web application developed in .net)

            sandeep you got this ??

      • #69 written by sandeep
        about 13 years ago

        and also, I m using windows as web development environment, how can I run the php script you have given? Please give suggestions!

        Thanks,
        Sandeep

  • #70 written by Sandy
    about 13 years ago

    I need a script to send bulk sms thru way2sms with same msg to all.
    thanks

    • #71 written by admin
      about 13 years ago

      You can use V2.0 of the class which supports passing a list of numbers to the send function as a an array. Although the v2.0 doesnt include way2sms as of now. Hope someone in here can help me migrate the old way2sms scripts to v2.0

      • #72 written by bhavesh
        about 13 years ago

        can’t we use looping in way2sms to sending multiple SMS ?

  • #73 written by michael
    about 13 years ago

    admin..does this work internationally and unlimited?
    i will need your help to run my website..would you be kind to contact me back.
    thank you.

    • #74 written by admin
      about 13 years ago

      This does not work all over the world. It actually depends on the gateway. The 160by2 gateway supports the maximum number of countries like India, Singapore, Kuwait, UAE etc. You can contact me using the Contact page (link on the top of the page)

  • #75 written by Dev
    about 13 years ago

    it seems that the advanced v 2 script doesn’t works on freesms8.com …
    showing a error ” Logging in … Sending SMS … Error encountered : ”

    But not the actual error …
    kindly look into the matter…

  • #76 written by Dev
    about 13 years ago

    it seems that the advanced v 2 script doesn’t works on freesms8.com …
    showing a error ” Logging in … Sending SMS … Error encountered : ”

    But not the actual error …
    kindly look into the matter and please restore it soon……

    • #77 written by admin
      about 13 years ago

      I will look into the issue when I find some time

  • #78 written by Naveen
    about 13 years ago

    Hi,
    Thanks for the code but Im gettin the following errors. I tried to clear them but wasn’t successful.

    could you please help me with these errors?

    Notice: Use of undefined constant “class – assumed ‘“class’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 2

    Notice: Use of undefined constant curl – assumed ‘curl’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 2

    Notice: Use of undefined constant php” – assumed ‘php”’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 2

    Warning: include_once(“classcurlphp”) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\Assignment6\test\send_sms1.php on line 2

    Warning: include_once() [function.include]: Failed opening ‘“classcurlphp”’ for inclusion (include_path=’.;C:\php5\pear’) in C:\wamp\www\Assignment6\test\send_sms1.php on line 2

    Notice: Use of undefined constant “class – assumed ‘“class’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 3

    Notice: Use of undefined constant sms – assumed ‘sms’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 3

    Notice: Use of undefined constant php” – assumed ‘php”’ in C:\wamp\www\Assignment6\test\send_sms1.php on line 3

    Warning: include_once(“classsmsphp”) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\Assignment6\test\send_sms1.php on line 3

    Warning: include_once() [function.include]: Failed opening ‘“classsmsphp”’ for inclusion (include_path=’.;C:\php5\pear’) in C:\wamp\www\Assignment6\test\send_sms1.php on line 3

    Fatal error: Class ‘sms’ not found in C:\wamp\www\Assignment6\test\send_sms1.php on line 5

    • #79 written by admin
      about 13 years ago

      Looks like your php scripts are corrupted. Ensure that all the php files in the zip are extracted to the same directory.

  • #80 written by Sandy
    about 13 years ago

    Dear Kiran Saheb,
    I was using your example.php script successfully from my website but I think my hosting people got suspicious and blamed me of overusing their server CPU at present my members are very less but with the time they will increase. I need another website and hosting service just for sending these free sms to my members who joins. Pls suggest me a reasonalble hosting service and that will simply allow me to send sms using your example.php without any danger of suspending my website. One more thing I want to ask you that if my hosting service is suspended will I be able to use the name of my website with other hosting party. How will I have control over my website name.
    Thanks
    Sandy

    • #81 written by admin
      about 13 years ago

      I use hostmonster.com/bluehost.com, they provide unlimited bandwidth for a very reasonable price. Around 3.5 K Rs per year.
      You can use your domain name with any hosting company , this is applicable if you bought the domain name separately from the hosting, like from providers like godaddy.com. But if the domain name came free with the hosting, then you might need to request them to transfer the domain .. although I am not sure about their policies.
      I have also heard that godaddy hosting is good.
      Just try to avoid using Indian hosting companies as bandwidth in India is costlier compared to US.

  • #82 written by rajinder kumar
    about 13 years ago

    tell me i want to get complete site like way2sms.com. i am ready to pay for it. from where to get it.

    • #83 written by admin
      about 13 years ago

      way2sms is not just a website. Its a combination of a web UI and a SMS gateway (offered by its parent company smscountry)
      So if you are buying just the website it wont be enough. You will need to pay for every SMS being sent using the website.
      Way2sms tries to cover up the SMS cost with the revenue from the ads. So if you are trying to do something similar, it might take some time for you to break-even as there wont be enough advertisers willing to pay unless the customer base is big enough.
      Hope it makes sense..

  • #84 written by hillol
    about 13 years ago

    Logging in … Sending SMS …
    Fatal error: Call to undefined function json_decode() in /www/110mb.com/t/i———talacse/htdocs/sms/gateway_freesmsapi_com.php on line 41

    • #85 written by admin
      about 13 years ago

      Looks like your hosting server runs PHP4. json-decode function was introduced in PHP5.

  • #86 written by Dev
    about 13 years ago

    please add freesms8.com also please at present its not working…….

    thanks in advance…

    • #87 written by admin
      about 13 years ago

      I have added freesms8.com, but it has stopped working recently. I have posted an update about this. Read the update dated 17th Dec ’10 on the top of the page.

  • #88 written by Afsal
    about 13 years ago

    Hey.. :)

    Nowdays 160by2 is not working sometimes I think its because thier mobile version site is down and you seems to using m.160by2 in the code to login and post sms right?

    Their website is still functional. So I belive it can be solved if you could use the website for posting the sms instead of m.160by2.com. The login is successful but the page m.160by2.com/SaveCompose.asp doesn’t exist and hence the sms is not getting send.

    I’m getting this maybe because I have made CURLOPT_FOLLOWLOCATION, 0. Anyhow is there a solution for it?

    • #89 written by admin
      about 13 years ago

      You are right Afsal. But I have decided to stop development. Read the update dated 17th Dec ’10 on the top of this page.

  • #90 written by Bishu
    about 13 years ago

    Sir,

    I want to use HTTP API for http://www.freesms8.com. When I use your code I got an error message as -

    Logging in … Sending SMS … Error encountered : One or more parameters are missing

    Please help to run it.

    Thanks in Advance.

    • #91 written by admin
      about 13 years ago

      I wish I could fix the code, but please read the update dated 17th Dec ’10 on the top of this blog post.

  • #92 written by Bishu
    about 13 years ago

    Sorry for my previous post.
    The error message is as follows

    Logging in … Sending SMS … Error encountered :

  • #93 written by Padhu
    about 13 years ago

    great work sir.both 160by2.com and freesmsapi are working fine.but freesms8.com is not working.
    The error message is as follows

    Logging in … Sending SMS … Error encountered .

    Please correct this problem and also add way2sms as it provides unlimited free sms.

    Otherwise,Fantastic work sir.

    • #94 written by admin
      about 13 years ago

      Pls read the update dated 17th Dec ’10 on the top of this blog post.

  • #95 written by dibyendu
    about 13 years ago

    I want to use http://www.freesms8.com for sending sms
    but when I run PHP SMS API v2.0 I got the following error…

    Logging in … Sending SMS … Error encountered :

    Please response as soon as possible..

1 2 3 4