<?php 
if (isset($_POST['formaction']) && ($_POST['formaction'] == 'add' || $_POST['formaction'] == 'edit'))
{
	$ID					= isset($_POST['ID']) ? $_POST['ID'] :'';
	$ADDR_ID 			= isset($_POST['addrid']) ? $_POST['addrid'] : '';
	$chkunsubscribe 	= isset($_POST['chkunsubscribe']) ? $_POST['chkunsubscribe'] : 0;
	$EMAIL				= trim($funcObj->AppendSlashes($_POST['txtemail']));
	$FIRSTNAME			= trim($funcObj->AppendSlashes($_POST['txtfname']));
	$LASTNAME			= trim($funcObj->AppendSlashes($_POST['txtlname']));
	$MISC_1				= trim($funcObj->AppendSlashes($_POST['txtcustom1']));
	$MISC_2				= trim($funcObj->AppendSlashes($_POST['txtcustom2']));
	$MISC_3 			= trim($funcObj->AppendSlashes($_POST['txtcustom3']));
	$IS_DELETED 		= trim($funcObj->AppendSlashes($chkunsubscribe));
	
	$error = "";
	
	if (empty($EMAIL))
	{
		$error .= "Email address cannot be left blank.<br />";
	}
	else if (!validate_email ($EMAIL))
	{
		$error 	= "Invalid e-mail address.<br />";
	}
	
	if (strlen($error))
	{
		$errorMsg = "<strong>Please correct the following error(s):</strong> <br />
		$error";
	}
}
?>