先PO上我的原始码
js部分
/* 补发验证MAIL */
$('#mailGet').ready(function(){
$('#mailSend').click(function(){
$.ajax({url:'mail_get.php', //指定执行页
cache:'false',
dataType:'html',
type:'POST',
data: $("#mailGet").serialize(), //表单全部字段
beforeSend:function(){
/* 在资料尚未回传之前,执行的JS语法内容 */
var mr_id = $('#mr_id').val();
if (mr_id == '') {
swal("发生错误","您尚未填写您的id。","error");
$('#mr_id').css("background-color","#FCE6F2");
return false;
}
var mr_mail = $('#member_mail').val();
if (mr_mail == '') {
swal("发生错误","您尚未填写您的mail。","error");
$('#mr_mail').css("background-color","#FCE6F2");
return false;
}
},
success:function(response){
/* 资料回传回来,执行的JS语法内容*/
$('#mailGetMsg').html(response); //指定回传资料位置点
}
});
});
});
PHP 部分
<div style="height:500px">
<form id="mailGet" method="post" ></form>
<input name="mr_mail" id="mr_mail" type="hidden" value="<? echo $member_mail
;?>">
<input name="mr_id" id="mr_id" type="hidden" value="<? echo
$_COOKIE[MemberID] ;?>">
<table width="800px" height="300px" border="0" cellspacing="5" >
<tr>
<td style="text-align:right">您所设定的电子邮件:</td>
<td ><a style="font-size:25px; color:#F00;"><? echo $member_mail
?></a></td>
</tr>
<tr>
<td colspan="2" style="text-align:center"><a id="mailSend" class="button
button-glow button-rounded button-raised button-primary">补发验证信</a></td>
</tr>
<tr>
<td style="text-align:right">更变电子邮件并发送验证:</td>
<td><input name="newmember_mail" type="text" placeholder="请输入新的电子
邮件"></td>
</tr>
<tr>
<td colspan="2" style="text-align:center"><a class="button button-glow
button-rounded button-raised button-primary">确认更改您个人电子邮件并发送验证
</a></td>
</tr>
</table>
<span id="mailGetMsg"></span>
</form>
接收端 mail_get.php
<?
sleep(2);
echo $_POST[mr_mail];
require ("php/cmsdb.php");
$sql= mysql_db_query ("$dbname", "select * from member where
member_id='$_POST[mr_id]' ");
$num = mysql_num_rows( $sql ); //计算目前资料表笔数
if ($num==0) {
echo "
<script>
MsgAlertOn(); $('.MsgTxt').text('无法取得相关资料,请重新确认。
');
</script>
";
exit;
/* 移动电话与电子邮件正确 */
} else {
echo "
<script>
setTimeout(function(){ location.href='./'; }, 3000); //</script>
";
}
接收不到值!请位各位大大们!是为什么???
感谢各位大大看了我那么长的程式码....先感谢了!