Jump to content

Need help with a (simple) script with SMS


Nieno

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

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"


$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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.