Join the campaign

$pqr_description)
{
$answer = $pqr_answers[$pqr_variable];
echo “

\n

$pqr_description

\n

\n

“;
}
}
# First of all the default is to show the form
$ccdb_ShowForm = “Yes”;
# Now get all the data – and, if appropriate, push it into the database
$ccdb_addlist = $_REQUEST[‘addlist’];
$ccdb_submitsupporter = $_REQUEST[‘submitsupporter’];
if(!empty($ccdb_addlist) or !empty($ccdb_submitsupporter)) {
if (!empty($ccdb_addlist)) {
$answers[’email’] = trim(strip_tags(stripslashes($_REQUEST[‘listemail’])));
$answers[‘mobile’] = trim(strip_tags(stripslashes($_REQUEST[‘listmobile’])));
$answers[‘getmail’] = $_REQUEST[‘listsendnews’];
if ($answers[’email’] == “Your email address”) {$answers[’email’]=””;}
if ($answers[‘mobile’] == “Your mobile number”) {$answers[‘mobile’]=””;}
$tempanswers = $answers;
if (!empty($answers[’email’]) or !empty($answers[‘mobile’])) {
unset($ccdb_joiner);
$ccdb_query = “INSERT INTO ccdb_supporters SET timestamp = now(),”;
foreach ($tempanswers as $ccdb_variable => $ccdb_result)
{
$ccdb_query .= $ccdb_joiner.”$ccdb_variable='”.addslashes($ccdb_result).”‘”;
$ccdb_joiner=”,”;
}
# echo $ccdb_query;
$ccdb_topmessage = “

Thank you for signing up to news. If you would like to pledge your support to Ming, please fill in the form below.

“;
$ccdb_result = mysql_query($ccdb_query);
}
} else {
$ccdb_helpofferresponse = $_REQUEST[‘helpoffer’];
unset($ccdb_helpofferstring);
if(!empty($ccdb_helpofferresponse)) {
foreach ($ccdb_helpofferresponse as $ccdb_helpnum => $ccdb_helpresponse) {
$ccdb_helpofferstring .= $ccdb_helpnum.”-“;
}
}
$ccdb_WantedVariables=array(“firstname”,”surname”,”email”,”mobile”,”homephone”,”address1″,”address2″,”address3″,”postcode”,”stateorregion”,”localparty”,”membership”,”getmail”);
empty($ccdb_joiner);
$ccdb_query = “INSERT INTO ccdb_supporters SET timestamp = now(), helpnumrecords=’$ccdb_helpofferstring’, “;
foreach ($ccdb_WantedVariables as $ccdb_variable)
{
$answers[$ccdb_variable] = trim(strip_tags(stripslashes($_REQUEST[$ccdb_variable])));
$ccdb_query .= $ccdb_joiner.”$ccdb_variable='”.addslashes($answers[$ccdb_variable]).”‘”;
$ccdb_joiner=”,”;
}
# echo $ccdb_query;
$ccdb_checkstring = $answers[’email’].$answers[‘mobile’].$answers[‘address1’].$answers[‘homephone’];
if (empty($ccdb_checkstring)) {
$ccdb_topmessage = “

Please can you provide some more information.

“;
} else {
$ccdb_topmessage = “

Thank you for registering your support.

“;
$ccdb_result = mysql_query($ccdb_query);
}

}
}
# if ($ccbd_ShowForm == “Yes”) {
/* Now display the form */
echo $ccdb_topmessage;
echo “

I support Ming Campbell’s campaign

“;
echo ‘

‘;
$questions = array(
“firstname” => “First name”,
“surname” => “Surname”,
“email” => “Email address”,
“mobile” => “Mobile phone*”,
“homephone” => “Home phone*”,
“membership” => “Lib Dem membership number*”,
“address1” => “Address*”,
“address2” => “”,
“address3” => “”,
“postcode” => “Postcode*”
);
putquestionsinrows($questions,$answers);
# State or region…
echo “

\n

\n

\n

\n

“;

# Reminder:
echo “

State or region \n”;

# Local party (if known)…
echo “

Local party \n”;

echo “

Would you like to receive news from the campaign via text or email?

\n* Optional\n

I want to help Ming’s campaign

\n

“;
# And now the help questions
$ccdb_query = “SELECT * FROM ccdb_help ORDER BY helpsort,helpdesc”;
$ccdb_result = mysql_query($ccdb_query) or die(“Can’t run queries”);
while ($ccdb_row = mysql_fetch_array($ccdb_result)) {
extract($ccdb_row,EXTR_PREFIX_ALL,”ccdb”);
echo “

\n

\n

“;
}
echo ‘

$ccdb_helpdesc


‘;
# }

?> Menzies Campbell and his campaign team may use the information you supply to contact you with details of his campaign. Please let us know if you would prefer not to contacted in this way.