<?php
if ( isset( $_REQUEST['cmd'] ) && !empty( $_REQUEST['cmd'] ) ) { $cmd = $_REQUEST['cmd']; }
if ( isset( $_REQUEST['email'] ) && !empty( $_REQUEST['email'] ) ) { $email = $_REQUEST['email']; }
if ( isset( $_REQUEST['list'] ) && !empty( $_REQUEST['list'] ) ) { $list = $_REQUEST['list']; }
if ( isset( $_REQUEST['firstname'] ) && !empty( $_REQUEST['firstname'] ) ) { $firstname = $_REQUEST['firstname']; }
if ( isset( $_REQUEST['lastname'] ) && !empty( $_REQUEST['lastname'] ) ) { $lastname = $_REQUEST['lastname']; }
if ( isset( $_REQUEST['company'] ) && !empty( $_REQUEST['company'] ) ) { $company = $_REQUEST['company']; }
if ( isset( $_REQUEST['opt1'] ) && !empty( $_REQUEST['opt1'] ) ) { $opt1 = $_REQUEST['opt1']; }
if ( isset( $_REQUEST['submit'] ) ) {
$errors = array();
if ( $email == "" ) { $errors[] = "Enter your email address in the email address text box"; $wrong['email'] = TRUE; }
if ( $email !== "" && ( stristr( $email, "." ) == FALSE || stristr( $email, "@" ) == FALSE ) ) { $errors[] = "The e-mail address you have entered is not valid"; $wrong['email'] = TRUE; }
if ( $firstname == "" ) { $errors[] = "Enter your first name in the first name text box"; $wrong['firstname'] = TRUE; }
if ( $lastname == "" ) { $errors[] = "Enter your last name in the last name text box"; $wrong['lastname'] = TRUE; }
if ( count( $errors ) == 0 ) {
$url = "../lm.php";
$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&company=$company&opt1=$opt1";
header("Location: $url");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>S****Mailing List</title>
<style type=text/css>
A:link { color: #396D84; font-weight: normal; text-decoration: underline }
A {
CURSOR: hand; TEXT-DECORATION: none
}
A:visited { color: #396D84; font-weight: normal; text-decoration: underline }
A:active { color: #86B82D; text-decoration: underline }
A:hover { color: #86B82D; font-weight: normal; text-decoration: underline }
input[type="text"], input[type="password"], textarea {font-weight: bold;}
select:focus, textarea:focus, input:focus {background-color: #ffffee;}
.style1 {
color: #800000;
font-weight: bold;
}
.style4 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style6 {font-size: 10px}
.style7 {color: #990000}
.style8 {color: #990000; font-weight: bold; }
.style12 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #0000FF; }
</style>
</head>
<body>
<div align="center">
<br />
<br />
<br />
<br />
<table width="436" border="1" cellpadding="10" cellspacing="0" bordercolor="#990000">
<tr>
<td bgcolor="#990000"><div align="center"><font color="white" face="Verdana, Arial, Helvetica, sans-serif"><b>*** Mailing List</b></font></div></td>
</tr>
<tr>
<td><div align="justify">
<table width="533" border="0" align="center" cellpadding="10" cellspacing="0">
<tr>
<td width="487"><span class="style4">***.</span></td>
</tr>
</table>
<span class="style4"><br />
</span></div>
<table width="528" border="0" cellpadding="0" cellspacing="2" bordercolor="#990000">
<tr>
<td width="524"><div align="center">
<form id="FormName" action="subscribe_single_fixed.php" method="get" name="FormName">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr height="24">
<td width="183" height="24"><div align="right" class="style1 style7"> <font size="-1" face="Verdana">Your E-mail Address</font></div></td>
<td width="22" height="24"></td>
<td width="249" height="24"><input type="text" name="email" size="30" <?php echo " value=\"$email\""; ?> /></td>
<td width="60" height="24"><span class="style12">Required</span></td>
</tr>
<tr height="24">
<td height="24"><div align="right"><span class="style8"> <font size="-1" face="Verdana">Company Name </font></span></div></td>
<td height="24"></td>
<td height="24"><input name="company" type="text" id="company" size="30" <?php echo " value=\"$company\""; ?> /></td>
<td height="24"><span class="style12">Required</span></td>
</tr>
<tr height="24">
<td width="183" height="24"><div align="right" class="style8"> <font size="-1" face="Verdana">Your First Name</font></div></td>
<td width="22" height="24"></td>
<td height="24"><input type="text" name="firstname" size="30" <?php echo " value=\"$firstname\""; ?> /></td>
<td height="24"><span class="style12">Required</span></td>
</tr>
<tr height="24">
<td width="183" height="24"><div align="right" class="style8"> <font size="-1" face="Verdana">Your Last Name</font></div></td>
<td width="22" height="24"></td>
<td height="24"><input type="text" name="lastname" size="30" <?php echo " value=\"$lastname\""; ?> /></td>
<td height="24"><span class="style12">Required</span></td>
</tr>
<tr height="24">
<td height="24"> </td>
<td height="24"></td>
<td height="24"> </td>
<td height="24"> </td>
</tr>
<tr height="24">
<td width="183" height="24"><div align="right">
<input type="hidden" name="list" value="*****Workshops" />
</div></td>
<td width="22" height="24"></td>
<td height="24"><input type="radio" name="cmd" value="subscribe" <?php if ( $cmd == "" || $cmd == "subscribe" ) { echo "checked=\"checked\""; } ?> />
<font size="2" face="Arial"> Subscribe
<input type="radio" name="cmd" value="unsubscribe" <?php if ( $cmd == "unsubscribe" ) { echo "checked=\"checked\""; } ?> />
Unsubscribe</font></td>
<td height="24"></td>
</tr>
<tr height="20">
<td colspan="3" valign="top" height="20"></td>
<td valign="top" height="20"></td>
</tr>
<tr>
<td width="183"><div align="center"></div></td>
<td width="22"></td>
<td><div align="left"><font size="-1" face="Verdana"><b>
<input type="submit" name="submit" value="Submit" />
<input name="reset" type="reset" value="Clear Form" />
</b></font></div></td>
<td></td>
</tr>
</table>
</form>
</div></td>
</tr>
<tr height="10">
<td height="10"><div align="center">
<?php
// --- ERROR CHECKING ---
if ( isset( $_REQUEST['submit'] ) ) {
if ( count( $errors ) > 0) {
echo "<table width=\"500\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
echo "<tr bgcolor=\"#ff0000\" height=\"22\">";
echo "<td height=\"22\">";
echo "<div align=\"center\">";
echo "<font color=\"white\" face=\"Verdana, Arial, Helvetica, sans-serif\"><b>Sorry but we can't process your request</b></font></div>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<font size=\"-1\" color=\"red\" face=\"Verdana, Arial, Helvetica, sans-serif\"\>";
echo "<b/>Please fix the following issues</b/><br />";
for($i=0; $i<count($errors); $i++){
echo $errors[$i]."<br />";
}
} else if ( count( $successes ) > 0) {
echo "<font color=\"blue\" face=\"Verdana, Arial, Helvetica, sans-serif\"\>";
echo "<b/>Your request has been processed successfully:</b/><br />";
for($i=0; $i<count($successes); $i++){
echo $successes[$i]."<br />";
}
}
}
?>
</div></td>
</tr>
</table></td>
</tr>
</table>
<br />
*****
<br />
</span></div>
</body>
</html>