get.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
请填写您在这里注册的电子邮箱地址,我们会将您的ID及口令,注册号发送到您的邮箱里。 <br>
<form name="form1" method="post" action="getpassword1.php">
<input name="mail" type="text" id="mail">
<input type="submit" name="submit" value="提交">
</form>
</body>
</html>got.php
<?php
if(isset($HTTP_POST_VARS['submit']) && $HTTP_POST_VARS['submit']!='')
{
$sql= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
echo "<br>";
echo "num=".$num."<br>";
if($num > 0)
{
$sql_user= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$query_user = mysql_query($sql_user);
$row_user = mysql_fetch_array($query_user);
sendSmallEmail($row_user['email'], "发送密码",$row_user['password'], $emailMode="text","bonnie");
echo "OK!";
}
else
{
echo "您输入的E_mail不正确!!";
}
}
function sendSmallEmail($to, $subject, $msg, $emailMode="text",$emailFrom)
{
//发送htm邮件
if ($emailMode=="html")
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$emailFrom."\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";
}
//发送普通文本
if ($emailMode=="text")
{
$headers .= "From: ".$emailFrom."\r\n";
$msg .="\n_欢迎";
}
//执行发送操作,并返回结果
if(@mail($to, $subject, $msg, $headers)) {
return 1;
}
else
{
Return 0;
}
} //end func
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
请填写您在这里注册的电子邮箱地址,我们会将您的ID及口令,注册号发送到您的邮箱里。 <br>
<form name="form1" method="post" action="getpassword1.php">
<input name="mail" type="text" id="mail">
<input type="submit" name="submit" value="提交">
</form>
</body>
</html>got.php
<?php
if(isset($HTTP_POST_VARS['submit']) && $HTTP_POST_VARS['submit']!='')
{
$sql= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
echo "<br>";
echo "num=".$num."<br>";
if($num > 0)
{
$sql_user= "SELECT * FROM $member_individual INNER JOIN $member_corporation ON $member_individual.email = $member_corporation.email where $member_individual.email='".$HTTP_POST_VARS['mail']."'";
$query_user = mysql_query($sql_user);
$row_user = mysql_fetch_array($query_user);
sendSmallEmail($row_user['email'], "发送密码",$row_user['password'], $emailMode="text","bonnie");
echo "OK!";
}
else
{
echo "您输入的E_mail不正确!!";
}
}
function sendSmallEmail($to, $subject, $msg, $emailMode="text",$emailFrom)
{
//发送htm邮件
if ($emailMode=="html")
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$emailFrom."\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";
}
//发送普通文本
if ($emailMode=="text")
{
$headers .= "From: ".$emailFrom."\r\n";
$msg .="\n_欢迎";
}
//执行发送操作,并返回结果
if(@mail($to, $subject, $msg, $headers)) {
return 1;
}
else
{
Return 0;
}
} //end func
?>
解决方案 »
- 使用数组元素出现Notice: Undefined offset:
- 高分求助 google 日历 api 调用
- 查询条件LINK出错
- 字符串替换的问题,请教高手
- 有关mysql : select count(*) from XXX的问题
- 求助数据库函数的使用问题
- 请---uuq(杜牧)----再进来一下.
- 高分紧急求助:为什么我的 PHP 程序几分钟不操作,Session 就检测不到了???
- 新版的zend studio11.0创建PHP文件没有结尾的标示符
- 表单POST提交有问题改用get则可以
- mail函数问题:
- 在家好,我想问一下有关购物车的问题,最好 feyge(菲戈..这是个告别的年代) 或 DFlyingchen(弱水三千)或唠叨看一下
action="got.php">