iframe或者AJAX或者弹个页面出来都可以。

解决方案 »

  1.   

    如果对Ajax不熟,就用iframe。把username传到iframe中判定是否存在
      

  2.   

    这个东西也要问,好多论坛都有!
    CSDN你登陆的时候密码没有填写看看他会显示什么!
      

  3.   

    下面的是登录的,改动一下,
    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;
    }


    }
      

  4.   

    AJAXPHP+JAVASCRIPT如果有中文的话,需要注意字符编码的问题.