| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/pcisecureform.com/php/ |
Upload File : |
<?php
function send_text($phone, $body, $site_code='', $text_type='', $real_site='usafa') {
//return 'We can\'t send texts right now. We are getting our numbers verified with the major cell carriers.';
require_once($_SERVER['DOCUMENT_ROOT'].'/php/Twilio/autoload.php');
$sid = "ACadee2d472e482b70b775d6c44034ed7f"; // Your Account SID from www.twilio.com/console
$token = "96242efaee5afa83cc1a83de75396164"; // Your Auth Token from www.twilio.com/console
include_once('/var/www/surfcrm.com/php/db_config_lc_user.php');
$txtwire_db = connect_lc2user_new('txtwire');
//check do not call list
$is_there = $txtwire_db->get_results("SELECT phone FROM do_not_call.phone WHERE phone='".$txtwire_db->clean($phone)."'");
if(!empty($is_there)) {
return 'do_not_call';
}
$site_sid = 'MGd4348f6a0d9e6226d9ce23c062a14083';
/*switch($real_site) {
case 'agf':
case 'agg':
case 'fa':
$site_sid = 'MG072e22ca7d579ea7d4f7e7cbbe5f5f66';
break;
case 'ggus':
case 'usaga':
case 'usagaorg':
$site_sid = 'MG2a6c2a62d666c5d36c0276a47cd7b7cd';
break;
case 'usafa':
$site_sid = 'MGd4348f6a0d9e6226d9ce23c062a14083';
break;
case 'nusaf':
case 'nusag':
$site_sid = 'MG9b935a3fc49c51829f512aea26be4362';
break;
}*/
if($text_type=='PCI Payment Link') {
$site_sid = 'MG072e22ca7d579ea7d4f7e7cbbe5f5f66';
}
try {
$client = new Twilio\Rest\Client($sid, $token);
$results = $client->messages->create(
$phone, // Text this number
[
'messagingServiceSid' => $site_sid,
'body' => $body
]
);
if(!empty($results->status)) {
if($results->status=='accepted') {
$txtwire_db->query("INSERT INTO txtwire.sent_texts
(
phone
,text_body
,ts
,txtwire_id
,first_status
,from_group
,site_code
,text_type
) VALUES (
'".$txtwire_db->clean(preg_replace('/[^0-9]/','',$phone))."'
,'".$txtwire_db->clean($body)."'
,NOW()
,'".$txtwire_db->clean($results->sid)."'
,'".$txtwire_db->clean($results->status)."'
,'usa'
,'".$txtwire_db->clean($site_code)."'
,'".$txtwire_db->clean($text_type)."'
)");
return 'Success';
} else {
return $results->error_message;
}
} else {
return $results->error_message;
}
} catch(Exception $e) {
return 'Failed to send message';
}
}
?>