Author Topic: Need help with a (simple) script with SMS  (Read 855 times)

0 Members and 1 Guest are viewing this topic.

Offline NienoTopic starter

  • Irregular
  • Posts: 1
    • View Profile
Need help with a (simple) script with SMS
« on: December 27, 2010, 08:15:30 PM »
Sorry, I've no idea where to place this topic.

Excuse me for my bad English.

Hi,

First of all, I've 0,01 knowlegde of PHP. I only know the basic of basicness. Excuse me for that.

I would like to set-up a simple script which does the following:

On a website is a numerically value (0,00).
Once a SMS has been sended, the SMS-system will request for an URL. That request will take care of raising the value on the website with a X value (e.g. 0,01).

How should I handle this?

I hope it's clear what I mean.
Thanks a lot.
« Last Edit: December 27, 2010, 08:19:50 PM by Nieno »

Offline cmattoon

  • Irregular
  • Posts: 46
  • Gender: Male
    • View Profile
Re: Need help with a (simple) script with SMS
« Reply #1 on: January 07, 2011, 07:51:52 PM »
Its hard to say without knowing specifics of your SMS system.
Typically, we use the mail() for our in-house projects (0000000000@vtext.com). If you're using a commercial SMS gateway, it really depends on how the program works. I don't have much experience with them.

To handle incrementing a value that's stored in the database, I'd probably set up a "listener" script that uses a GET request to increment the number.

(pseudocode)... SMS gateway visits "listener.php?val=inc"
Code: [Select]

$val=$_GET['val'];

if($val == "inc"){
$sql = mysql_query("SELECT value FROM database");
$sql ++;
$result = mysql_query("UPDATE value IN database");
if($result){
//Success
}else{
//Fail
}
}else{
//Do nothing, invalid 'val' value.
}







Again, I have no idea what your SMS gateway supports.... this is just a general idea from what I've used with other listener scripts.
-Curtis