| 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/usafundingapplications.org/abot/ |
Upload File : |
<?
if(!function_exists('PostFields'))
{
function PostFields($url, $fields)
{
$fields = http_build_query($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, "LCAPI cUrl Agent");
curl_setopt($ch, CURLOPT_VERBOSE, true);
ob_start();
$data = curl_exec ($ch);
ob_end_clean();
curl_close ($ch);
return $data;
}
}
if(!function_exists('formatPhone'))
{
function formatPhone($phone)
{
$partA = substr($phone, 0, 3);
$partB = substr($phone, 3, 3);
$partC = substr($phone, 6, 4);
$result = '(' . $partA . ') ' .$partB . '-' . $partC;
return $result;
}
}
if(!function_exists('safeString'))
{
function safeString($string)
{
$string = strip_tags($string);
$string = stripslashes($string);
return preg_replace('/[^A-Za-z0-9\-\@\.\_\ ]/', '', $string);
}
}
if(!function_exists('siid'))
{
function siid()
{
return sprintf(
'%04x%04x%04x%04x%04x%04x%04x%04x',
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535),
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)
);
}
}
if(!function_exists('fieldSort'))
{
function fieldSort($array, $sort, $direction)
{
foreach($array as $key => $value)
{
$bArray[$key] = strtolower($value[$sort]);
}
if($direction == "DESC")
{
arsort($bArray);
}
else
{
asort($bArray);
}
foreach($bArray as $key => $value)
{
$cArray[] = $array[$key];
}
return $cArray;
}
}
if(!function_exists('escape'))
{
function escape($string)
{
$string = mysql_real_escape_string($string);
$string = htmlentities($string);
return $string;
}
}
if(!function_exists('dollarFormat'))
{
function dollarFormat($amount)
{
$formattedAmount = number_format(floor($amount * 100) / 100, 2, '.', '');
return $formattedAmount;
}
}
if(!function_exists('sanitize'))
{
function sanitize($input)
{
if (is_array($input))
{
foreach($input as $var => $val)
{
$output[$var] = sanitize($val);
}
}
else
{
if(get_magic_quotes_gpc())
{
$input = stripslashes($input);
}
$output = cleanInput($input);
}
return $output;
}
}
if(!function_exists('cleanInput'))
{
function cleanInput($input)
{
$search = array(
'@<script[^>]*?>.*?</script>@si',
'@<[\/\!]*?[^<>]*?>@si',
'@<style[^>]*?>.*?</style>@siU',
'@<![\s\S]*?--[ \t\n\r]*>@'
);
$output = preg_replace($search, '', $input);
return $output;
}
}
if(!function_exists('validEmail'))
{
function validEmail($email)
{
$isValid = true;
$atIndex = strrpos($email, "@");
if (is_bool($atIndex) && !$atIndex)
{
$isValid = false;
}
else
{
$domain = substr($email, $atIndex+1);
$local = substr($email, 0, $atIndex);
$localLen = strlen($local);
$domainLen = strlen($domain);
if($localLen < 1 || $localLen > 64)
{
$isValid = false;
}
else if($domainLen < 1 || $domainLen > 255)
{
$isValid = false;
}
else if($local[0] == '.' || $local[$localLen-1] == '.')
{
$isValid = false;
}
else if(preg_match('/\\.\\./', $local))
{
$isValid = false;
}
else if(!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain))
{
$isValid = false;
}
else if(preg_match('/\\.\\./', $domain))
{
$isValid = false;
}
else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local)))
{
if(!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local)))
{
$isValid = false;
}
}
if($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A")))
{
$isValid = false;
}
}
return $isValid;
}
}
?>