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
https://forums.phpfreaks.com/topic/222769-need-help-with-a-simple-script-with-sms/
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 ([email protected]). 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.