Dear All,

I  have  question  about  syntax  to  make http request and send email
through CLI command

I have script while the sender [Mobile Phone] send sms to my gateway and then if
their  request have right result, the gateway will reply back to their
mobile  phone, but if the result is nothing, the sms gateway will send
an email to webmaster
here  is  my php script, pls revise if my script have some thing wrong
or missing

#!/usr/local/bin/php -q
// file name : pickup.php
// Ambil data last row di table sms_store

include "setup.php";

$query = "SELECT * from sms_store where smsc='Receive SMS' ORDER BY sms_number DESC 
LIMIT 0,1";
$result = mysql_query($query);
if (!$result) error_message(sql_error());

  // show field for current row
  while($show = mysql_fetch_array($result)) {

      // pemisahan char di msg_content berdasarkab rule
      // 1 untuk Menampilkan Summary dari IP,IPK dan IP sem kermarin dari sender
      // 2 untuk menampilkan nila per KODE mata kuliah sender pada current semester
      // kemudian baru di ikuti nomor NBI dari sender
      // Sementara ini coba langusung ke NBI aja ya...

      //  $rule = substr($show["msg_content"],0,1);   //nah ini belum di berlakukan
      // sementara pake ini dulu --> Langsung tulis NBI nya aja

      $sms_time = substr($show["sms_time"],6,2).'-'.
      substr($show["sms_time"],0,4).' - '.

      echo "Waktu : $sms_time <br>";
      echo "Action : $smsc <br>";
      echo "Dari : $org_sms <br>";
      echo "Ke : $dest_sms <br>";
      echo "Isi SMS : $msg_content <br>";
      echo "<br>";

      echo "Isi MSG Content : $matang <br>";
      echo "<br>";

      //Sekarang query ke DB MHS
      $cari_nbi= "SELECT * FROM m_mhs where nbi = $matang";
      $ketemu = mysql_query ($cari_nbi);

      if (!$ketemu) then
       $receipent ="[EMAIL PROTECTED]";
       $subject ="Failed to pickup DATA for $matang";
       $body_mail ="Some on try to get information about IPK by $org_sms for $nbi";

       //Sending email for every failed pickup data to webmaster
       //ini  juga  saya  tanyakan bener tdk untuk kirim email through
       mail ($receipent,$subject,$body_mail);
       {  while($tampil = mysql_fetch_array($ketemu)) {


      //tampakan hasil query ke layar;

      echo "Nama = $nama_mhs <br>";
      echo "NBI  = $nbi <br>";
      echo "IP Sekarang = $current_ip <br>";
      echo "IP Lalu = $old_ip <br>";
      echo "IPK = $ipk <br>";
      // nah ini yg saya tanyakan benerkah syntax nya demikian ..???
  exec "lynx --dump$org_sms&text=$nama_mhs+&$nbi+$current_ip+$old_ip+&ipk";;

highly appreciate for yr help

Warm regards,

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to