|
Re: Store SMS to database: msg#00429org.user-groups.linux.philippine
Hi, I was just wondering what brand/specification of SMS modem do you use and if you know where it could be bought. HGC On Wed, 2004-06-30 at 15:04, CG Haravata wrote: > Hi Jeffrey, > > we here at Asia Pacific College use an SMS modem with GSMLIB as the > application... what I did was create my own PHP script to poll the > modem and, if there are messages, will get them and save them into a > MySQL database... the following is the script. i hope this can help > you. > > -------- start of script -------------- > <?php require_once("db.config.php");?> > <html> > <head> > <title>SMS Testing</title> > </head> > > <body> > <?php > $view_message = "gsmsmsstore -s /home/wwwrun/smsstore -l"; > $delete_message = "gsmsmsstore -d /home/wwwrun/smsstore --delete 0"; > > function get_msg_no(){ > global $cn; > $select = "Select msg_no from " . cTBLLOG . " order by msg_no desc"; > $rs = mysql_query($select,$cn) or die("Query Error1"); > $rows = mysql_fetch_object($rs); > $msg_no = $rows->msg_no; > return $msg_no; > } > > exec($view_message,$com); > $total = count($com); > > if($total!=0){ > $total = 16; > $com[2] = substr($com[2],14); > $sclen = strrpos($com[3],"'")-13; > $com[3] = substr($com[3],13,$sclen); > $com[4] = substr($com[4],23); > $com[5] = substr($com[5],12); > $com[6] = substr($com[6],27); > $com[7] = substr($com[7],26); > $oalen = strrpos($com[8],"'")-22; > $com[8] = substr($com[8],22,$oalen); > $com[9] = substr($com[9],21); > $com[10] = substr($com[10],20); > $com[11] = substr($com[11],14); > > $com[12] = substr($com[12],17); > $com[13] = substr($com[13],18); > $udlen = strrpos($com[14],"'")-12; > $com[14] = substr($com[14],12,$udlen); > $com[14] = addslashes($com[14]); > > for($i=0;$i<=$total;$i++){ > echo $com[$i] . "<br>"; > } > > $msg_no = get_msg_no(); > $msg_no = $msg_no + 1; > $insert_record = "insert into " . cTBLLOG . > " > (msg_no,msg_type,sc_address,mmts,reply_path,ud_hi,status_report,orig_address,prot_iden,data_coding,sc_timestamp,ud_length,ud_header,user_data) > values > > ('$msg_no','$com[2]','$com[3]','$com[4]','$com[5]','$com[6]','$com[7]','$com[8]','$com[9]','$com[10]','$com[11]','$com[12]','$com[13]','$com[14]')"; > mysql_query($insert_record) or die("Query Error2"); > > exec($delete_message,$str,$ret); > > > }else{ > echo "No SMS Messages"; > } > > ?> > </body> > </htm > -------- end of script -------------- > > -------Original Message------- > > From: Philippine Linux Users Group Mailing List > Date: 06/30/04 14:41:16 > To: Philippine Linux Users Group Mailing List > Subject: [plug] Store SMS to database > > Good Day! > > Does anyone know a tool that works like Gnokii and can store > retrieved and sent SMS to a database (more specifically a MySQL > database)? We have tried using a couple of applications that connects > a > mobile phone to a PC (we are currently using gnokii) but we haven't > seen > a software that can save SMS directly to a database. Any suggestions > would really be appreciated.. > > thanks in advance... > > -- > learning while lurking > > Jeffrey G. Ubalde <jgubalde-XaFKWIIMX1X5MSPxmebm+VaTQe2KTcn/@public.gmane.org> > > -- > Philippine Linux Users' Group (PLUG) Mailing List > plug-sJCYDywXB4m9hMQLrSLElQC/G2K4zDHf@xxxxxxxxxxxxxxxx (#PLUG @ > irc.free.net.ph) > Official Website: http://plug.linux.org.ph > Searchable Archives: http://marc.free.net.ph > .. > To leave, go to http://lists.q-linux.com/mailman/listinfo/plug > .. > Are you a Linux newbie? To join the newbie list, go to > http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie > > > > > > ______________________________________________________________________ > -- > Philippine Linux Users' Group (PLUG) Mailing List > plug-sJCYDywXB4m9hMQLrSLElQC/G2K4zDHf@xxxxxxxxxxxxxxxx (#PLUG @ > irc.free.net.ph) > Official Website: http://plug.linux.org.ph > Searchable Archives: http://marc.free.net.ph > . > To leave, go to http://lists.q-linux.com/mailman/listinfo/plug > . > Are you a Linux newbie? To join the newbie list, go to > http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie -- Best Regards, Hamilton G. Chua Eamil : osirishinzen-ktR7oAotx3zQT0dZR+AlfA@xxxxxxxxxxxxxxxx Yahoo : osirishinzen-/E1597aS9LQAvxtiuMwx3w@xxxxxxxxxxxxxxxx MSN : hgcphoenix-PkbjNfxxIARBDgjK7y7TUQ@xxxxxxxxxxxxxxxx ICQ : 24979799 URL : http://www.tala-arawan.net -- Impossible is just a big word thrown around by small men who find it easier to live in the world they've been given than to explore the power they have to change it. Impossible is not a fact. It's an opinion. Impossible is not a declaration. It's a dare. Impossible is potential. Impossible is temporary. Impossible is nothing -- Adidas Ad Campaign -- Philippine Linux Users' Group (PLUG) Mailing List plug-sJCYDywXB4m9hMQLrSLElQC/G2K4zDHf@xxxxxxxxxxxxxxxx (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: On volunteerism =) (was Re: Filipino/Tagalog Translation - is it really needed ?): 00429, dido-dcz5jOA4Wtcdc6zLPptBHg |
|---|---|
| Next by Date: | Consider SVN (WAS: Setting up a Debian CVS Server): 00429, Ariz C. Jacinto |
| Previous by Thread: | Re: Store SMS to databasei: 00429, CG Haravata |
| Next by Thread: | Re: Store SMS to database: 00429, Chancellor Sy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |