lainard Posted May 30, 2012 Share Posted May 30, 2012 Please kindly help with actionhook here is my code: sendsms.php <? function actionhook_InvoiceCreated($vars) { $ordernumber = $vars['invoiceid']; // $amount = $vars['amount']; // $invoiceid = $vars['invoiceid']; // $paymentmethod = = $vars['paymentmethod']; // lookup relid from the invoiceid $result = mysql_query("SELECT relid, amount FROM tblinvoiceitems WHERE type='Hosting' AND invoiceid='".$ordernumber."'"); $grab_relid = mysql_fetch_row($result); $relid = $grab_relid[0]; $amount = $grab_relid[1]; // lookup the phone number $result = mysql_query("SELECT value FROM tblcustomfieldsvalues WHERE fieldid='1' AND relid='".$relid."'"); $pesan="Your order information amount=$amount to activate please send PAID#$ordernumber#$amount to 06546544545"; $grab_nohp = mysql_fetch_row($result); $nohp = $grab_nohp[0]; $var1 = "JIVE"; $var2 = "564654dsgd"; exec("/usr/bin/perl /path_to_my_perl/sendsms.pl $var1 $var1 $nohp $pesan", $output); print_r($output); } ?> and below is my sendsms.pl script to send this sms #!/usrbin/perl -w use HTTP::Request::Common qw(POST); use LWP::UserAgent; use HTTP::Cookies; use strict; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); for (my $i = 3543; $i < 4140; $i++) { # log in to authentication page. #my $req = HTTP::Request->new(GET => 'http://someurl_com/sms_info.html'); #$req->authorization_basic('admin', 'pass'); #my $content = $ua->request($req)->as_string; #print "Login to GOIP $i\n"; my $req = HTTP::Request->new(GET => 'http://someurl_com/sms_info.html'); $req->referer("http://someurl_com/default/sms_info.html"); $req->authorization_basic('admin', 'pass'); #my $content = $ua->request($req)->as_string; #print "SMS Sent $i\n"; my $req = POST 'http://mysms_gateway.url', Content => ["action" => "$ARGV[0]", "smskey" => "$ARGV[1]", "telnum" => "$ARGV[2]", "smscontent" => "$ARGV[3]"]; $req->referer("http://mysms_gateway.url"); $req->authorization_basic('admin', 'password'); my $content = $ua->request($req)->as_string; exit; } i could send the sms if i just wrote this php code and execute it and sms works! testingsms.php <?php $var1 = "JIVE"; $var2 = "564654dsgd"; $var3 = "+6281361622796"; $var4 = "testing"; exec("perl /path_to_script/name.pl $var1 $var1 $var3 var4", $output); print_r($output); ?> Any help would be appreciate 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.