How to Automate SMS from PHP mysql at Particular point of Time - php

I have a website where people will book for Site visits.The Support Executive Confirms Site visit in the previous day. Once the Site visit is confirmed on the day on which site visit should happen the customer should receive SMS in morning telling that you have site visit today as requested.
I have Third party SMS Service
Now I Should Run a Code in PHP, MySQL which sends a SMS in the morning on which the site visit should happen
How can I Do that

Cron -> starts PHP-Script , PHP Script reads records from the SQL Table and checks if an SMS has to be sent, i assume its sms over mail, so you can use the integrated php function to send out mails to the sms gateway. For the guy confirming the visits, create another site with proper authentication where he can access the table and agree with the site-visits and anotherone for the customer to register for site visits

You need a cron job set to run in morning which will call your php file have code for looking in database for customers you need to send sms to.
Yo need to register to sum sms gateway provide 2 good one i know is clickatell and eztexting.
You can get there api for sending sms in there website.
Happy Smsing :D

Set a Cron Jobs in your Control panel.Try this link
http://www.devx.com/DevX/Article/39900/1954

If you would like to try an entirely different approach, check out:
Sent.ly - http://sent.ly
I am the founder of Sent.ly and thought maybe Sent.ly could help you out...
Sent.ly allows you to use an Android phone as an SMS gateway. So... you could just purchase a cheap Android phone ($150 or so) and set up Sent.ly on it and put a SIM in the phone.
By calling the Sent.ly API, the SMS would go out through the SIM in your Android phone. Sent.ly also has the option for scheduling an SMS for sending later which is your use case.
This also allows your PHP application to RECEIVE SMS in addition to just sending it out.
You can setup rules and if an incoming message matches a rule, it would be posted to a PHP page of your choice.
Since I am a great fan of stackoverflow, I would like to invite you to try Sent.ly. We would be happy to set you up with extra credits if you like. Just mail us at support#sent.ly
Cheers,
Varun

I have developed a system like this for use with some of my clients, and you can easily use it to integrate with your website or applications, through HTTP POST or WebServices (using PHP, C# or whatever).
If you are interested just leave an email or other contact information as a reply to this answer and I will gladly send you a sample code of how to send SMS, setting the desired time for sending messages, beyond other things, through our system.
You will not need to have any kind of cron knowledge and setup, it is all handled by our system, and the code is pretty simple and straight forward. You will only need to call our services upon site visit confirmation, setting the desired message sending time, and our system will do the rest.
Best regards.

Related

user verification using SMS (php)

I am stuck in a situation in which when a user registers, he/she get a confirmation SMS on his/her mobile number, and he/she able to confirm their application by replying to the confirmation SMS, be repling like YES/NO to that confirmation sms..
Is there any SMS gateway available which provides the suitable functionality, I mean an API which takes user input from sms reply..
thanks in advance
Twilio has the ability to receive sms messages.
https://www.twilio.com/docs/quickstart/php/sms
There is a definite solution available for this. Try exploring with FrontLine SMS that offers a similar functionality, though you will have to then use a 10 digit registered number to send your confirmation SMS.
How to use frontline sms:
Get an internet dongle from a cellular company (Idea, Airtel,etc)
connect dongle to PC
install frontline SMS
Frontline SMS detects dongle.
Frontline SMS API's available to read incoming SMS on dongle and forward to your server with POST/GET methods.
Try it out & let me know it work.
Regards,
Mihir.
PS: i use Huawei dongle + idea connection.
You can use mVaayoo (http://www.mvaayoo.com/sms-gateway-features-benefits.html)
It supports Easy 2-Way SMS Integration with Website, ERP, CRM or any application.
They will provide the rich documentation which helps you to solve your problem.
You can go to that site and register and test it..
There are so many things in the documentation like return values by getting the return values.
You can use http://routesms.com/
This is easy to use and cheap. I used it for like 3 years. They have all types of API with documentation.
The answer is Yes, try Clickatell, they also support India.
Please note that this is copied answer from another question...original This question is a duplicate.
Expensive, but it is possible.

Receiving and broad casting messages from mobile phones with PHP

There is a web site
http://www.pringit.com
i want to receive text messages from mobile phones using php, like this web site.
the user makes his account at this web site and registers his mobile fone number there then if admin or any other person who has made groups there (at the web site) he can send a message from his mobile to the web site server then from that server the message is broad casted or multi casted or uni casted according to the sender's wish, my question is that i want to do a work like this, now i want some guidance, about this, i want to know that is that task is done by using some sort of api like tropo or urbanairship etc?, if that is then i will go for api, or there is another way to do this, plz. guide me how to do this, or how to go about this thanx an Regards Saad
You must use any service providers API to send sms. You can search for the best service provider in your area.
If you purchase some credits ,most of the case they will have give the integration guide or code
You can select XML or json API for this . You will have to do the rest of code likek user authentication,grouping etc
http://www.twilio.com/ is one of them

Web form autorespond with SMS

I have been asked to design a website for a client but one of the requirements is that there is a form which includes such things as name, email, dob and mobile number once the user submits the form a SMS is automatically sent to the users mobile almost like a autoresponder.
How to achieve this?
This can be done using an external SMS gateway which will not be free, but also not awfully expensive.
However, you say you are not a programmer. For this to be built well and most important of all, safely, it might be a good idea to use the services of one.
If you want to do it yourself, consider using a pre-paid plan with the SMS provider of your choice so you can't be ruined by a bot flooding your form with thousands of requests.
Web sms functionality can be added to any web application or website. As #Pekka said you need to use an external SMS gateway and to connect your application to this SMS Gateway. Most SMS gateways provide external API which can be used to do that. They usually have documentation which you can use to find out how to integrate SMS notification in your PHP code. Unfortunately there are no reliable free sms service provides so you have to pay for this sms service. You can check http://www.phpjabbers.com/web-sms/ which seems to work a lot easy. Their integration code is pretty simple:
<?php
$SMSLIB["phone"] = '44111222333'; // your phone number
$SMSLIB["key"] = 'abcdefghijklmnopqrs'; // your personal API code
include("smslib.php"); // we will provide you with smslib.php file
sendSMS("test message", $SMSLIB["phone"]); // function which sends the message
?>
The easiest way to do this is to send it to their mobile numbers assigned email address (which is different by each carrier) then have it sent like a normal email.
The only issue is you will probably have to have a Dropbox with each carrier then add something to the PHP that changes the email address (ex. $tmobile would be tmomail.net).
More info:
How To Send Email To Any Cell Phone (for Free)
Most of mobile carriers offer free Email To SMS gateways which can be used to forward simple text emails to a mobile phones. And the good news, majority of those gateways are free and available to the general public.

How to update a mysql database via SMS text messaging?

I want to add an additional functionality to a CMS I am making that will allow users to add content to a site via text message. The user should be able to upload an image and add text and send the message to a number which when received will update the database accordingly.
Can this be done, and can it be done via PHP because that's the only language I know? Also what would be the general outline to achieve such a thing?
You have to find a SMS gateway that supports "incoming" of SMS. Click-a-tell is generally the one people choose because of their API and documentation, they aren't free though. If you do a quick Google search for "SMS Gateway" you'll find plenty of other solutions.
Once you choose the gateway you want to go with, the rest of the process is easy. You would just handle the SMS as a regular request into your application.
Hope that helps you get started!
Use one of the many SMS gateways out there like Twilio (whom I work for, but loved before I was an employee) which has a really simple API and great documentation. There are tons of PHP examples. When you receive a message, a simple POST request is made to a URL you specify with parameters for To, From and Body. Also if you return text from the URLs you use to receive messages you can respond back to them. You can also initiate outbound SMS from the same number using the REST API.
Twilio does not currently support MMS (needed for your image uploading requirement) and is not free, but you only pay for what you use at $.01 per message.
Completing the answer by Raphael Caixeta, I recommend that you use the standalone PHP binary to run a pre-determined script, which parameters you'll get from the SMS/MMS. This way you can separate the two process:
1) Make a script and test it by running it through the command line.
2) Implement the SMS/MMS receiver software so that it parses the messages and runs the first script with custom parameters.
You can use a GSM/3G modem (or dongle) to receive SMS messages. And this sms software can read those messages from the modem in real time and put them automatically in your database.

Processing input data from a phone though SMS

I currently have a php script that reads email messages sent from phones and then it posts them on the internet...
I want to do the same thing but instead of reading emails, I would like to process the data through a SMS.
so, if someone sends a sms to X number, my program would get the message through this X number and use it in the site.
What would I need?
You have a lot of options here. Generally speaking you need to first acquire the number that people can SMS to. Afterwards a callback will be issued to you when someone sends and SMS and your PHP script can process the message and figure out what to do with it.
You essentially have a few options for exposing the SMS
Go with a dedicated short-code. Eg someone sends a text to 53234 and you will get a callback to deal with it. This is an expensive option. It will cost you generally around $2500/mo minimum not including per messaging fees. You can requisition a short code through a provider such as Open Market. You have to get approval for the short code which might take as much as 6 weeks.
Go with a shared short code. This is a bit cheaper -- you pay per message and it usually costs anywhere from .02 - .10 /msg depending on your msg volume. You get a keyword such as DOLLY that people have to preface before texting. So they would text DOLLY INPUT TEXT HERE to 53234 now and you would receive the callback with INPUT TEXT HERE. Celltrust and others provide shared short codes.
Use a public api that allows people to text in through something such as TextMarks. Textmarks is like a shared short code requires keyword usage + users to subscribe. However it is free which is great and has a nice callback API. I believe a service called Mozes also provides similar service. Finally, if you want you can set up a Twitter account and have people text to their number. Facebook also a similar API that allows you to use their FBOOK shortcode.
Ish's answer was great. I'd like to point out an additional free option.
Most carriers allow you to send SMS messages to email addresses. The SMS text gets inserted into the body of the email and the subject is carrier dependent. Once the email is sitting in your inbox, you can access it by the method of your choice.
This method has worked for me in a personal project requiring remote communication with my computer when all I had was a cell phone without internet capabilities.
This Wikipedia page shows how many carries support this (practically all).
Just try not to violate anyone's terms of service, you could always host the email account yourself.

Categories