PRC Compassion will be directing the faith-based response to Gulf Region disaster relief. Your tax-deductible contribution will help churches around the state and in the region respond to relief needs.

function my_empty($val){
if($val == “”){
$valid = ‘no’;
}else{
$valid = ‘yes’;
}
return $valid;
}

if($_GET['id'] == ‘1′){
$valid = ‘yes’;

if (my_empty($_POST['first']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['last']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['email']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['phone']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['street']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['city']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['state']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['zip']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['cc_name']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['c_card']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['exp_date']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['sscode']) == ‘no’){
$valid = ‘no’;
}
if (my_empty($_POST['donate']) == ‘no’){
$valid = ‘no’;
}

if($valid == ‘no’){
echo “Please check for missing field and complete them.

“;
?>

Please call 1 866 435 6557 to donate, or fill out the form below.


Personal Information
First Name:
Last Name:
Email:
Telephone:
Street:
City:
State:
Zip Code:


Credit Card Information

Name as it Appears on Card:
Credit Card:
Expiration Date (mm/yy):
Security Code (3 digits):
Donation Amount: $


Other Donations

Please List Non-financial Donations here:

}//end if valid == no
elseif($valid == ‘yes’){
$DEBUGGING = 1; # Display additional information to track down problems
$TESTING = 1; # Set the testing flag so that transactions are not live
$ERROR_RETRIES = 2; # Number of transactions to post if soft errors occur

$auth_net_login_id = “prccomp09″;
$auth_net_tran_key = “53Fr8X58zq25hUA7″;
#$auth_net_url = “https://certification.authorize.net/gateway/transact.dll”;
# Uncomment the line ABOVE for test accounts or BELOW for live merchant accounts
$auth_net_url = “https://secure.authorize.net/gateway/transact.dll “;

$authnet_values = array
(
“x_login” => $auth_net_login_id,
“x_version” => “3.1″,
“x_delim_char” => “|”,
“x_delim_data” => “TRUE”,
“x_url” => “FALSE”,
“x_type” => “AUTH_CAPTURE”,
“x_method” => “CC”,
“x_tran_key” => $auth_net_tran_key,
“x_relay_response” => “FALSE”,
“x_card_num” => $_POST['c_card'],
“x_card_code” => $_POST['sscode'],
“x_exp_date” => $_POST['exp_date'],
“x_description” => “PRC Compassion’s Donation “,
“x_amount” => $_POST['donate'],
“x_first_name” => $_POST['first'],
“x_last_name” => $_POST['last'],
“x_address” => $_POST['street'],
“x_city” => $_POST['city'],
“x_state” => $_POST['state'],
“x_zip” => $_POST['zip'],
“x_email” => $_POST['email'],
“x_other_donation” => $_POST['list'],

);
$fields = “”;
foreach( $authnet_values as $key => $value ) $fields .= “$key=” . urlencode( $value ) . “&”;
###$ch = curl_init(”https://certification.authorize.net/gateway/transact.dll”);
### Uncomment the line ABOVE for test accounts or BELOW for live merchant accounts
$ch = curl_init(”https://secure.authorize.net/gateway/transact.dll “);
curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, “& ” )); // use HTTP POST to send form data
### curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ###
$resp = curl_exec($ch); //execute post and get results
curl_close ($ch);

$text = $resp;
$tok = strtok($text,”|”);
$count = “0″;

while(!($tok === FALSE)){
$count ++;

if ($count ==”1″){
$num = $tok;
}

if ($count ==”4″){
$reason = $tok;
}
$tok = strtok(”|”);
}

if ($num == “1″){
$results =
” . $reason . “

” .
Your contribution has been received.

Thank you for your support.

“;
}
elseif ($num ==”2″){
$results =
” . $reason . “

” .
Thank you for your support. Unfortunately, your credit card transaction did not go through. Please try again.

“;
}
elseif ($num ==”3″){
$results =
” . $reason . “

” .
Thank you for your support. Unfortunately, your credit card transaction did not go through. Please try again.

“;
}

echo $results;
}//end if valid == yes

} // end if id == 1
else {
?>
Please call 1 866 435 6557 to donate, or fill out the form below.


Personal Information
First Name:
Last Name:
Email:
Telephone:
Street:
City:
State:
Zip Code:


Credit Card Information

Name as it Appears on Card:
Credit Card:
Expiration Date (mm/yy):
Security Code (3 digits):
Donation Amount: $


Other Donations

Please List Non-financial Donations here:

}
?>