By entering the contest using this form, you agree to be added to Mike Rickard's newsletter mailing list (if you aren't already). You can unsubscribe at anytime.
Privacy Policy
You also acknowledge that your questions (along with answers) may be published on my website, MySpace page or other similar website. Each question will be published with the first and last initial, city and state of the person asking the question.
$errors = '0';
if (array_key_exists('_submit_check',$_POST))
{
echo "
";
if (!(isFldEntered($_POST['fname'])))
{ echo "First name must be entered
";
$errors = 'true'; }
elseif (strlen(trim($_POST['fname'])) > 20)
{ echo "Max length for first name is 20
";
$errors = 'true'; }
if (!(isFldEntered($_POST['lname'])))
{ echo "Last name must be entered
";
$errors = 'true'; }
elseif (strlen(trim($_POST['lname'])) > 20)
{ echo "Max length for last name is 20
";
$errors = 'true'; }
if (isFldEntered($_POST['addr1']))
{ if (strlen(trim($_POST['addr1'])) > 50)
{ echo "Max length for first address is 50
";
$errors = 'true'; }}
if ((isset($_POST['addr2']) and !empty($_POST['addr2'])))
{ if (strlen(trim($_POST['addr2'])) > 50)
{ echo "Max length for second address is 50
";
$errors = 'true'; }}
if (!(isFldEntered($_POST['city'])))
{ echo "City must be entered
";
$errors = 'true'; }
elseif (strlen(trim($_POST['city'])) > 25)
{ echo "Max length for city is 25
";
$errors = 'true'; }
if (!(isFldEntered($_POST['state'])))
{ echo "State must be entered
";
$errors = 'true'; }
elseif (strlen(trim($_POST['state'])) > 20)
{ echo "Max length for state is 20
";
$errors = 'true'; }
if (isFldEntered($_POST['zipcode']))
{ if (strlen(trim($_POST['zipcode'])) > 10)
{ echo "Max length for Zip Code is 10
";
$errors = 'true'; } }
if (!(isFldEntered($_POST['email'])))
{ echo "Email must be entered
";
$errors = 'true';
}
elseif (strlen(trim($_POST['email'])) > 50)
{ echo "Max length for email is 50
";
$errors = 'true';
}
elseif (!preg_match($pattern, $_POST['email']))
{ echo "Email address is not valid
";
$errors = 'true';
}
if (!(isFldEntered($_POST['question1'])))
{ echo "Question 1 must be entered
";
$errors = 'true';
}
echo "
";
//posting without errors
if ($errors == '0')
{
// write entry to database
include_once("mysql.inc");
$link = mysql_connect($host,$user,$password);
if ($link)
{
$db_selected = mysql_select_db($database);
if ($db_selected)
{
$query = "INSERT INTO contest2
(id_contest,
firstName,
lastName,
Addr1,
Addr2,
city,
state,
zipcode,
email,
question1,
question2,
addedDate,
IPaddr)
VALUES
('',
'" . $_POST['fname'] . "',
'" . $_POST['lname'] . "',
'" . $_POST['addr1'] . "',
'" . $_POST['addr2'] . "',
'" . $_POST['city'] . "',
'" . $_POST['state'] . "',
'" . $_POST['zipcode'] . "',
'" . $_POST['email'] . "',
'" . $_POST['question1'] . "',
'" . $_POST['question2'] . "',
now(),
'" . getenv('REMOTE_ADDR') . "')";
$result = mysql_query($query);
}
mysql_close($link);
//check if email in maillist
$onlist = "No";
include_once("mysqlml.inc");
$link = mysql_connect($ml_host,$ml_user,$ml_password);
if ($link)
{
$db_selected = mysql_select_db($ml_database, $link);
if ($db_selected)
{
$query = "select * from phplist_user_user where ucase(email) = " . '"' . strtoupper($_POST['email']) . '"';
$result = mysql_query($query);
if ($result)
{ if (mysql_num_rows($result) > 0) $onlist = "Yes";
}
}
mysql_close($link);
}
// write entry to database
include_once("sendmail.inc");
$msgBody = trim($_POST['fname']) . " " . trim($_POST['lname']) . " from " . $_POST['city'] . "," . $_POST['state'] . " asked:\n\nQuestion 1\n" . $_POST['question1'] . "\n\nEmail: " . trim($_POST['email']) . " (On mailing list: $onlist)";
sendmail('mike','Contest Entry Received',$msgBody);
while (@ob_end_clean());
//$thanksPage = "contestconfirm.php";
//header("Location: http://www.mikerickard.com/pages/$thanksPage");
//exit();
echo "
";
echo "";
echo "";
echo "Talk To Me Tuesdays";
echo " ";
echo "Thank you for entering the contest.";
echo "Your entry has been recorded...Good Luck";
echo " | ";
echo "
";
echo "
";
exit();
}
}
}
?>
* = Required Fields