FrontlineSMS

FrontlineSMS allows you to text message with large groups of people anywhere there is a mobile signal.

HI ALL, Could someone help in editing the script below please

This script is nonresponsive i.e. frontline  sends a blank sms as an autoreply when i send a message with the keyword 'MARKET' or 'RICE'.below is the edited script:

WHERE MIGHT BE THE PROBLEM? Help to edit please.


<?php
$server="localhost";
$user="root";
$pass="NANOTECHZ";
$db="bidhaa";
$market=$_GET['product'];
mysql_connect("$server","$user","$pass");
mysql_select_db("$db") or die('CANNOT CONNECT TO Bidhaa DATABASE');

$query = mysql_query( "SELECT * FROM `prices` WHERE market=\'$market\';)");
$msg=$market;
While ($result=mysql_fetch_array($query,MYSQL_ASSOC))
{
$msg= $msg." ".$result['maize']." ".$result['onions']." ".$result['rice']." ";
}
echo $msg;
?>

the frontline confg is:

http://localhost/htdocs/market.php?product=${message_content}

(i am using xampp server)

HOW I WANT IT TO BE:

when FLSMS recieves an sms with a keyword either the name of the market for example 'TABAKA', or the name of the commodity e.g. 'MAIZE' , it calls the php script which returns the various commodity prices which FLSMS inturn sends the result to the sender as an autoreply.

THIS IS THE 'PRICES' TABLE:

<div id="displayoptions" />
Full Texts id MARKET MAIZE ONIONS RICE

Edit Delete 1 TABAKA 50 200 180

Edit Delete 2 RONGO 55 220 185

Edit Delete 3 SUNEKA 60 250 190

Views: 23

Reply to This

Replies to This Discussion

Hi Paul,

 

Is there any chance you can share a screenshot of your external command setup?  This way we can check all your settings are as expected.

 

Thanks,

 

Alex

Hi

Alex Thanks for the reply, indeed the forum is great; i hope am not bothering you much,but believe me in our group am the only guy who is conversant with php though not much. below are the requested screenshots. any help will be highly appreciated:Thanks in advance

Hi!

 

Looks like there is an error in your script - it's being reported in the outgoing message from FrontlineSMS.

 

Try accessing your script in a web browser and seeing if it performs as expected there.

 

Alex

RSS

Photos

  • Add Photos
  • View All

© 2013   Created by kiwanja.net.   Powered by

Badges  |  Report an Issue  |  Terms of Service