昨天得到了一些很好的帮助,一些邮件程序的php代码,忘记了我也需要知道如何包含代码,以便邮件程序知道在复选框中选中哪个选项。这是一个简单的“加入邮件列表”选项,只有“是”或“否”选项可用。PHP电子邮件提供答复复选框
代码如下:
<?php
$state = 0;
// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct send the message and show this page
mail("[email protected]", 'Online Form: '.$subject, "\n".$message."
\n\n".$name."\n\n".$lastname."\n\n".$from."\n\n".$_SERVER['REMOTE_ADDR']." \n\n".'mailinglist: '.$mailinglist, "From: $from");
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
$state = 2;
} else if(isset($message) and $message!=""){
// if verification code was incorrect then return to contact page and show error
$state = 1;
}
if ($state == 0) { ?>
我试图用这个有点玩,看看我能计算出来,但想到之前,我超前了我会停下来,完全搞砸了:
<td align="left"><input type=checkbox name="mailinglist" id="mailinglist" value="1<?php echo $_GET['mailinglist'];?>">Yes<input type=checkbox name="mailinglist" id="mailinglist" value="2<?php echo $_GET['mailinglist'];?>">No<font face="Verdana" size="3" color="#666666"></font><br> </td></tr><tr valign="top" align="right"> <td nowrap><font face="Verdana" size="3" color="#666666">comments (<span class="R">*</span>)</font></td>
什么是前一个问题? – Tarik
@Braveyard,来自昨天的前一个问题正在纠正重定向问题。新的问题是如何发送邮件发送邮件列表:是或否,取决于检查的选项。 – Leah
'md5($ verif_box)。'a4xn''是一种验证方法的玩笑。不要这样做。 – sanmai