日期:2014-05-16 浏览次数:20433 次
<script type="text/javascript">
function mailbox(strEmail){
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("您的浏览器不支持AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
var xx = document.getElementsByName("email")[0].value;
if (xx == ""){document.getElementById("mailbox_msg").innerHTML='<div><font color=red>邮箱不能为空!</font></div>';}
else if(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
if(xmlHttp.readyState==4)
{
var x = xmlHttp.responseText;//获取传过来的值
if(x == 1)
{
ee = "1";
document.getElementById("mailbox_msg").innerHTML='<div><font color=green>邮箱可以使用!</font></div>';}
else
{document.getElementById("mailbox_msg").innerHTML='<div><font color=red>邮箱已经被注册</font></div>';}
}
}
else{document.getElementById("mailbox_msg").innerHTML='<div><font color=red>邮箱地址不正确</font></div>';}
}
var name=document.blooger.email.value;//这里老是错误 显示获取不到值
xmlHttp.open("get","<?php echo "http://".$_SERVER['HTTP_HOST']."/Login/"; ?>mail.php?youx="+name,true);
xmlHttp.send(null);
alert(name);
}
</script>
<div style="margin-left:30px;">
<form name="blooger" action="blogger.php?action=update" method="post" id="blooger" enctype="multipart/form-data" >
<div class="item_edit">
<li>
<?php echo $icon; ?><input type="hidden" name="photo" value="<?php echo $photo; ?>"/><br />
头像<br />
<input name="photo" type="file" /> (支持JPG、PNG格式图片)
</li>
<li>昵称<br /><input maxlength="50" style="width:185px