FrontlineSMS allows you to text message with large groups of people anywhere there is a mobile signal.
hi alex,
we can retrieve message easily from mysql database,and sent t0o flsms and finally to the mobile user..but the now problem is how can we update the database by a messge,like if the user send say rice 25 .then it has to update the database table row ion that rice to 25.
my focus here is .hw can i save the keyword name in this case,say for ex,if i saved keyword as rice .then how can i retrieve 25 in the message content..n give that value to the php script.....will you please help me out in this regard...
regards,
ramakrishna.p
Tags:
Permalink Reply by Morgan Belkadi on February 25, 2011 at 8:47am
Permalink Reply by ramakrishna on February 26, 2011 at 12:08am morgan,i got you what you said ,if you put PRICE as a keyword ,then my question is what i need to include in the url,anyhow i have to get the variable "rice " in my php script to set the value "25" .i have to get the whole message content like for example say :price rice 25 is the message content,now php script hav to get the input saparately as price in one variable,rice to another variable,and 25 to another variable.how can i fed this from flsms to php..and even if i write saparately keyword for every item,its nt a efficient one,its as like filling all keywords in the software....
i hope you got me ,what i said to you...
thanks in advance,
regards,
ramakrishna.p
Permalink Reply by Morgan Belkadi on February 26, 2011 at 5:39pm Hi,
let's try to keep this simple:
Just create a single keyword, like PRICE, and set an external command action for it.
This action would be an HTTP Request, reaching a web script you wrote, and where the whole SMS content is passed.
It should look like : http://yourdomain/yourscript.php?content=${message_content}
That way, your script will receive everything the user wrote after "price".
Then, just split the request (see http://fr.php.net/manual/en/function.explode.php), and you'll have your different arguments.
Hope that helps.
Morgan
Permalink Reply by ramakrishna on February 27, 2011 at 11:39pm hi kmorgan,
thank you very much,actually now i got to kno,why we are using $messge content, thanks a lot morgan,i ll back to you if i got any doubt ok,keep in touch..
regards,
ramakrishna.p..
Permalink Reply by Morgan Belkadi on February 28, 2011 at 4:34am Hi Ramakrishna,
${message_content} is one of the subtitution variables recognised by FrontlineSMS. This token will be replaced by its actual value at sendtime.
Let's take an example:
- You have a "SAY" keyword, which forwards messages to your mobile
- The contact "FLSMS Fan" (number +123456) writes: "SAY FrontlineSMS is awesome"
Then the substitutions variable will look something like:
${sender_name} -> FLSMS Fan
${sender_number} -> +123456
${keyword} -> SAY
${message_content} -> FrontlineSMS is awesome
Then, in your Autoforward action, you could write this as the text message:
Hi, ${sender_name} (${sender_number}) just used the keyword "${keyword}" and is saying: ${message_content}
This will send you something like:
Hi, FLSMS Fan (+123456) just used the keyword "SAY" and is saying: FrontlineSMS is awesome
---------
Now you can maybe understand better why we are using the ${message_content} substitution variable in our PRICE example:
http://yourdomain/yourscript.php?content=${message_content}
This way, your PHP script will have in its "content" variable, the value of everything following the keyword "PRICE".
Examples:
PRICE rice 25 ----> The PHP "content" variable will be : "rice 25"
PRICE pepper 30 ----> The PHP "content" variable will be : "pepper 30"
In both cases, splitting the "content" variable into words (with the "space" character) will result in having the product (first word) and the actual price (second word).
Hope you understand it better now :-)
Best of luck,
Morgan
Permalink Reply by ramakrishna on May 11, 2011 at 7:04am hi morgan,
till now i was doing my website,that too both in english and also in our regional language kannada.it s very nice,and even we got many prize for that.and in that we are providing almost all information regarding farmers needs.
now with regarding to the FLSMS i ve one doubt regarding my code that i written...
i ll paste here..
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$produit=$_GET['produit'];
$produit = explode(" ", $produit);
$second=$produit[1];
mysql_select_db("frontlinesms", $con);
mysql_query("UPDATE prduct SET price=$second
WHERE pname = 'mango'");
mysql_close($con);
?>
i ll send the message as mango 25...now my intension here is to update the table by name prduct with mango price as 25.
but now am getting error like <br><fontsize>.....that is page source is commming as reply messge to me.and mango price automettically set to zero..
hiope you reply for this...
Permalink Reply by ramakrishna on May 11, 2011 at 7:24am
© 2013 Created by kiwanja.net.
Powered by