如何解决无刷新验证用户是否存在? iframe或者AJAX或者弹个页面出来都可以。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果对Ajax不熟,就用iframe。把username传到iframe中判定是否存在 这个东西也要问,好多论坛都有!CSDN你登陆的时候密码没有填写看看他会显示什么! 下面的是登录的,改动一下,function login(){if(document.getElementById("uid").value==""||document.getElementById("pwd").value==""){ document.getElementById("info").innerHTML="用户名或密码为空!"; } else{ startRequest(); }}var xmlHttp; function createXMLHttpRequest(){ if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } }function startRequest(){ createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("POST", "admin_validate.php?action='login'&uid="+document.getElementById("uid").value + "&pwd=" + document.getElementById("pwd").value, true); xmlHttp.send(null); } function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { if(xmlHttp.responseText=="isvalid"){ window.location.href='pindex.php'; } else{ document.getElementById("info").innerHTML = xmlHttp.responseText; } } } } AJAXPHP+JAVASCRIPT如果有中文的话,需要注意字符编码的问题. 关于radio的值 求删除超链接正则表达式的写法。 ZDE注释用的slash键在哪里? 这样的两个表怎么关联(急) 用mail()函数通过远程smtp服务器发送时失败 真的不知道問題出在什麼地方 简单的数据库连接问题 求助[制作导航系统] 請教大家!!我怎樣計算我的网站要使用的空間大小???我要放到人家的服務器上。 plz help editplus最新版本好像减少了很多PHP函数 散分了,个人感觉SMARTY没多少优点,难道是错觉吗?评论就有分
CSDN你登陆的时候密码没有填写看看他会显示什么!
function login(){
if(document.getElementById("uid").value==""||document.getElementById("pwd").value==""){
document.getElementById("info").innerHTML="用户名或密码为空!";
}
else{
startRequest();
}
}var xmlHttp;
function createXMLHttpRequest(){
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}function startRequest(){
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("POST", "admin_validate.php?action='login'&uid="+document.getElementById("uid").value + "&pwd=" + document.getElementById("pwd").value, true);
xmlHttp.send(null);
} function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
if(xmlHttp.responseText=="isvalid"){
window.location.href='pindex.php';
}
else{
document.getElementById("info").innerHTML = xmlHttp.responseText;
}
}
}
}