Forum Moderators: coopster

Message Too Old, No Replies

Incoming SMS text message to PHP

         

partha

8:58 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



have you ever heard of a way to get an SMS text message sent from a mobile phone to activate a PHP script?

I want to be able to write a note on my phone and SMS it to a PHP script that enters the note in a database.

jatar_k

9:00 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could use [procmail.org...]

we have used that to read emails and do auto inserts into a db for a forum

partha

11:56 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



procmail doesn't appear to support SMS. am I missing something?

HeadBut

11:59 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



Isn't SMS just an email message?

jatar_k

1:04 am on Jul 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



send the message to an email address that procmail is checking

partha

3:42 am on Jul 17, 2005 (gmt 0)

10+ Year Member



I don't think an sms is the same as an email. My service (t-mobile) provides an email address @tmomail.net that forwards all messages sent to it to my phone as an SMS, but I can't send emails from my phone. if I put in an email address for the SMS, it fails.

email to SMS gateways seem to be pretty common, but I can't find an SMS to email gateway

mogenshoj

8:48 am on Jul 17, 2005 (gmt 0)

10+ Year Member



I use a sms gateway on my site, where people pay to get their account upgraded. Whenever a sms is send a php file is automatically called on my server, as part of the sms gateway.

The sms text is recieved in the script as a POST variable. So you can do with it whatever you want.

My provider is danish, but im sure you can find something similar in english.

narrowboater

10:37 am on Jul 17, 2005 (gmt 0)

10+ Year Member



Partha, I think I can help on the SMS-to-email part of the problem. A business called IntelliSMS provides just this service. We're using them for a new project and are finding them very helpful. SMS messages can be forwarded by them either as emails or by HTTP post. Best wishes.

ergophobe

4:09 pm on Jul 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've just been looking into this, strangely enough, though I won't be doing anything with it for a long while. In addition to the one mentioned above, there are many SMS gateways. Just do a google search on SMS Gateway. Many will have tutorials on how to intercept the SMS message with a PHP script.

There was a pretty good tutorial [codewalkers.com] on codewalkers.

partha

6:17 pm on Jul 18, 2005 (gmt 0)

10+ Year Member



the codewalker tutorial is only for sending sms.

intellisms has a very useless website, and when I tried to use their contact form to ask how I sign up, it gave me a CGI error

dmorison

8:51 pm on Jul 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the UK there are a stack of companies that will set you up with a "keyword" on one of their SMS short codes, so you can build systems around the "Text BLOG + your message to 12345" (where BLOG is the keyword you lease) type model.

They all seem pretty flexible with regards delivery, being able to setup more or less anything including HTTP POST (the target of which can be your PHP script).

I've just done a quick search and the short code market does not seem to be so well developed in the US - perhaps due to the disparity of networks across your much wider geographic region.

If you're determined to do this and don't need want to pay a service provider or have premium rate per-SMS charges then you could always roll your own system using a pay-as-you-go handset, the Nokia PC Connectivity SDK 3.0 [forum.nokia.com] and a PC dedicated to the cause sat in a dark corner of your home. Please note however that this is not a straight forward option if you have absolutely no experience of Windows software development.

Sanenet

9:00 pm on Jul 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to be able to write a note on my phone and SMS it to a PHP script that enters the note in a database

Don't know where you are in the world, but most European phone companies allow you to send emails from your handset. In which case, set up a dedicated email account, and write a php script that checks that account every x (15? 20?) minutes. Leave it running in the backgroud, doesn't occupy anything on the server.

Then, you just send the email to the server and the php script, spotting the new email, carries out whatever action you want it to.

Setting up an SMS gateway for this would be too complex & expensive (unless you plan to have quite a lot of coverage from different users)

narrowboater

5:00 pm on Jul 23, 2005 (gmt 0)

10+ Year Member



Partha, Hmm. Just checked intellisms.com and I see what you mean above. They are not the same people I'm using who are at intellisms.co.uk - I expect you'll already have done something else, but just in case you haven't, do take a look at that .co.uk site. Hope this is more helpful. Jon