Hello.
I would like to forward the messages that get recived by this programme and 
send them to a different number.
Now how do i do that without sending to the person who sent the message.

Say the number is 26771445566.

Plus how can i make sure that the message is not empty from the sender.
Here are examples of a sender 

Sender                 Time                                Message
26771445566         11:01-    12:00:00                Please send me a Pizza 
with extra cheece plus 2 cokes and a hot dog.

regards



#!/usr/bin/perl -w
use DBI;

$dsn= "dbi:mysql:db_pu:localhost";
my $user= "mysql";
my $password = "mysql123";
$dbh = DBI->connect($dsn,$user,$password);

##################################GET ARGS ##########################
$msg = $ARGV[1];
$source = $ARGV[0];

$msg =~ s/\"/' /ig;  

$time = localtime();
open (OUTFILE ,">>C:\\logs\\pu.txt");
print OUTFILE "$time\t$source\t$msg\n";
close(OUTFILE);

$found =1;
  {

 if ($found == 1)
  {

 $statement = "insert into t_main (time_in, cli, msg) values 
(now(),'$source','$msg')";
 $sth= $dbh->prepare("$statement");
 $sth->execute;
 $sth->finish;

 print "Thank you for sending your request. Give us 1 hour to process it. SAME 
DAY PULA ENERGY GAS DELIVERY.\n";
   }
  }
 $dbh->disconnect;



Reply via email to