close(); include('articles/db_connect.php'); include('articles/session_facade.php'); $latest = getLatest(5); $articleCategoryNumbers = countCategoryMembers(); include('articles/db_close.php'); //$latest = array(); ?> false, "lastname" => false, "email" => false, "message" => false ); $quirky = array("firstname" => false, "lastname" => false, "email" => false ); if ( $_REQUEST['subject'] == "Form Submission" ){ $ip = $_SERVER['REMOTE_ADDR']; //if this is an entry from the form for validation, we will place in the user input into the database // $db = 'gregAlgoWriter'; //$link = mysql_connect('72.167.233.85', 'gregAlgoWriter', 'y6yGH0ip2') ; //if (! $link); //mysql_select_db($db , $link); // mysql_query( "INSERT INTO contact (FirstName, LastName, email, message,IPAddress ) VALUES('".$firstname."', '".$lastname."', '".$email."', '".$message."', '".$ip."' )" ) or die(mysql_error()); // mysql_close($link); } /*Check for spam the old fassioned way, using matches for to, cc, and bcc */ function spamcheck($field) { if(strpos($field, "to:") !== false || strpos($field, "cc:") !== false || strpos($field, "bcc:") !== false ){ return TRUE; } else { return FALSE; } if ( trim( $field ) == "" ){ return true; } else{ return false; } } /*Check the email using a regex, this pretty much makes the spamcheck function useless, but I'll leave it just in case */ function emailCheck($field){ if( (strpos($field,"@") === FALSE || strpos($field,".") === FALSE )) //not found - alert { return true; } else{ return false; } } /*Checks for an empty field */ function fieldcheck($field){ if ($field == "" ){ return true; } else return false; } /*Now go through the form values and look for empty or invalid values */ if ( fieldcheck($firstname) ){//blank first name $valid = "firstName"; $empty["firstname"] = true; } if ( preg_match( "(^[a-zA-Z-' ]+$)",$firstname) != 1 ){//quirky first name $valid ="quirkyFirstName"; $quirky["firstname"] = true; } if ( fieldcheck($lastname) ){//no last name $valid = "lastName"; $empty["lastname"] = true; } if ( preg_match( "(^[a-zA-Z-' ]+$)",$lastname) != 1 ){//quirky last last name $valid ="quirkyLastName"; $quirky["lastname"] = true; } if ( fieldcheck($email) ){//no email $valid = "email"; $empty["email"] = true; } if ( fieldcheck($message) ){//no message $valid = "message"; $empty["message"] = true; } if ( spamcheck( $email ) || emailCheck( $email ) == true ){ $valid = "spam"; $quirky["email"] = true; } if ( preg_match( "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$)", $email ) != 1 ){ $valid = "invalidEmail"; $quirky["email"] = true; } //now if its the first time loading the form, all fields will be blank...do this so nothing is echo'd below if ( fieldcheck($email) && fieldcheck($message) && fieldcheck($firstname) && fieldcheck($lastname) ){ $valid = "FALSE"; } $error = NULL; if ( $valid == "TRUE" ){//weve made it this far, valid everything, send me the mail $myEmailAddress = "gregcope@naturefocused.com"; //echo('Emailing:'.$myEmailAddress.' '.$lastname.' '.$firstname.' '.$message); $header = "From: $email\r\n"; //$header .= "MIME-Version: 1.0\r\n"; //$header .= "Content-type: text/html\r\n"; //echo $header; $myEmail = "gregcope@algosome.com"; $emailTitle = "Feedback from ".$firstname." ".$lastname; if ( mail( $myEmail, $emailTitle, $message, $header ) ){ header( "Location: http://www.algosome.com/redirect.html" ); }else{ $error = "We're sorry, your message could not be sent - please contact us at gregcope at algosome dot com"; // echo "We're sorry, your message could not be sent - please contact gregcope at algosome dot com"; } } $email = stripslashes($email); $message = stripslashes($message); $firstname = stripslashes($firstname); $lastname = stripslashes($lastname); if ( strpos($email, 'hacker') !== false ){ header("Location: http://www.fbi.gov/about-us/investigate/cyber/cyber"); } ?> Contact Algosome Software Design

Contact

'.$error.'

'; } ?>

Please fill in the form and we will respond as soon as possible, usually within a few business days.

latest Articles

software

contact

'.$error.'

'; } ?>

To contact Greg Cope, please use the form below. All fields are required.

*";}else{echo '>';} ?>First Name
*";}else{echo '>';} ?>Last Name
*";}else{echo '>';} ?>Email
Inquiry