2-Way SMS Question

2-Way SMS Question SearchSearch
Author Message
Shekhar Sagar Srivastava
New member
Username: Shekharcoddy

Post Number: 1
Registered: 11-2010
Posted on Saturday, November 13, 2010 - 03:54 pm:   

I Want to know that is it possible That When NowSMS Recieve any SMS, It Should Check the Database Created Manually, For The Specific Code, Just like a recharge coupon Code and if the specific Code is found in the database it should reply a successful message and should cancel that code from being used another time, and if anybody try to register the same code again, it should reply an error message that " The Code Had Been Used Already"

Just as we used to recharge our mobiles, with the recharge coupon, or top up cards.

and if it is possible than how can we implement it

Thanks in advance.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7935
Registered: 10-2002
Posted on Saturday, November 13, 2010 - 04:43 pm:   


Yes, you would need to write some script (such as PHP or ASP) to interface with your database and perform whatever processing logic you want to take on the code that is received from the user.

Basically, you'd configure NowSMS with a 2-way command that passes the sender phone number and text of the message to your script. (If using PHP or ASP, your script would run on a separate web server. You could also write a Windows JScript or VBscript that runs locally, but I'm more familiar with the web technologies.)

There's a simple PHP example that shows you how to parse the sender and text of the message: http://support.nowsms.com/discus/messages/1/3991.html

And there's a simple ASP example here: http://support.nowsms.com/discus/messages/1/4420.html

If you want to go the Windows JScript or VBscript route, there is a simple example of that here: http://support.nowsms.com/discus/messages/1/333.html

There's also a good guide on getting started with the 2-way SMS facility here: http://support.nowsms.com/discus/messages/1/4520.html

Shekhar Sagar Srivastava
New member
Username: Shekharcoddy

Post Number: 2
Registered: 11-2010
Posted on Saturday, November 13, 2010 - 06:31 pm:   

Hi Bryce Norwood, Thanks For Your Reply But I Want one More Help, Could You Please Provide Me The PHP Script, With The Methodology above.

Thanks in advance
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 2649
Registered: 08-2008
Posted on Tuesday, November 16, 2010 - 10:54 pm:   


We don't have any PHP scripts with database examples. The reason for this is because every database is going to be different, depending on what your application is trying to do.

There are some good PHP/MySQL tutorials on the web ... try this search query: http://www.google.com/search?q=php+mysql+example

When NowSMS receives an SMS message, it passes the detail to whatever script is configured as a 2-way command, like in the PHP example at http://support.nowsms.com/discus/messages/1/3991.html.

You can use whatever variable names you want in the script. But if you use the example URL format, from the PHP script, the phone number of the SMS sender is accessed as the variable $_REQUEST['sender'], and the text of the SMS message is accessed as the variable $_REQUEST['text'].

If you want to reply back to the sender directly, you use the PHP echo command to specify what you want to send.

I realise it would be easier if we had an example that includes the database interfacing, but depending on your application needs, you're going to layout your database differently than someone else would.

NowSMS Support