Viewing file: e-mail_form.php (3.83 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? if ($ID){ include("../include/settings"); include("../include/db_connect"); $query = "SELECT * FROM email WHERE ID = $ID"; $entry = mysql_query($query, $db); $recipient = mysql_fetch_array($entry); $modify = true; }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <head> <title>Manage e-mail subscribers database</title> <link rel="stylesheet" type="text/css" href="style.css"> <script language="JavaScript" type="text/javascript"> <!--hide from older browsers
function checkIt(){
var address = document.email.address.value; var matchPattern = /\w+@\w+\.\w+/; var matches = matchPattern.test(address); if (address.length < 1){ alert("Please enter an e-mail address for this recipient"); return false; } else{ if (!matches){ alert("The e-mail address you have entered: " + address + ", appears invalid\n\n E-mail addresses must have the format:\n someone@somewhere.com, .net, .org, etc...") return false; } } } //stop hiding--> </script> </head>
<body> <br> <center> <span class="title"><?print($modify ? "Change E-mail subscriber settings" : "Add new e-mail subscriber");?></span><br><br> </center> <form action="upload_e-mail.php" method="post" name="email" id="email" onsubmit="return checkIt()"> <?print($modify ? "<input type=\"hidden\" name=\"ID\" value=\"$ID\">" : "");?> <?print($modify ? "<input type=\"hidden\" name=\"ID\" value=\"$ID\">" : "");?> <table border="2" bordercolor="#222244" cellpadding="0" cellspacing="0" align="center"><tr><td> <table align="center" border="0"cellpadding="0" cellspacing="0"> <tr> <td><br> </td> </tr> <tr> <td>First Name:</td> <td><input type="text" name="first" size="25"<?print($modify ? "value =\"$recipient[first]\"" : "");?>></td> </tr> <tr> <td>Last Name:</td> <td><input type="text" name="last" size="25"<?print($modify ? "value =\"$recipient[last]\"" : "");?>></td> </tr> <tr> <td>E-mail Address:</td> <td><input type="text" name="address" size="25"<?print($modify ? "value =\"$recipient[address]\"" : "");?>></td> </tr> <tr> <td colspan="2"><input type="radio" name="active" value="yes"<?print((($modify && $recipient[active] == "yes") || (!$modify)) ? " checked" : "");?>> Activate <input type="radio" name="active" value="no"<?print(($recipient[active] == "no") ? " checked" : "");?>> De-activate</td> </tr> <tr> <td colspan="2"><hr width="90%" size="1" noshade></td> </tr> <tr> <td colspan="2"> <input type="checkbox" name="option_1" value="yes"<?print(($modify && ($recipient[option_1] == "yes")) ? " checked" : "");?>> Option 1</td> </tr> <tr> <td colspan="2"> <input type="checkbox" name="option_2" value="yes"<?print(($modify && ($recipient[option_2] == "yes")) ? " checked" : "");?>> Option 2</td> </tr> <!--<tr> <td colspan="2"> <input type="checkbox" name="option_3" value="yes"<?print(($modify && ($recipient[option_3] == "yes")) ? " checked" : "");?>> Option 3</td> </tr> <tr> <td colspan="2"> <input type="checkbox" name="option_4" value="yes"<?print(($modify && ($recipient[option_4] == "yes")) ? " checked" : "");?>> Option 4</td> </tr> <tr> <td colspan="2"> <input type="checkbox" name="option_5" value="yes"<?print(($modify && ($recipient[option_5] == "yes")) ? " checked" : "");?>> Option 5</td> </tr>--> <tr> <td colspan="2" align="center"><br><input type="submit" value="<?print($modify ? "Make changes" : "Add to e-mail list");?>"><br> </td> </tr> </table> </td></tr></table> </form> <div align="center" class="title"> <br><a href="upload_e-mail.php?delete=yes&ID=<?print("$ID");?>">Delete This Entry</a> </div> </body> </html>
|