Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-12-2007, 08:31 AM   PM User | #1
leoz2z
New to the CF scene

 
Join Date: Dec 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
leoz2z is an unknown quantity at this point
IE ok,but FF not work

my login.asp can't work in FF
JS:
Code:
function CheckForm()
{
.......
.......
	var url = "Login.asp?action=check&checkcode="+checkcode.value+"&username="+ escape(username.value)+"&psw="+escape(psw.value);
	xmlhttp.open("get",url,true);
	xmlhttp.onreadystatechange = function()
		{
			if(xmlhttp.readystate == 4 && xmlhttp.status ==200)
			{
			message = xmlhttp.responseText;
			//alert(message);
			switch(message)
				{
				case "differentcode":
				alert("wrong checkcode");
				break;
				case "erro_username":
				alert("user doesn't exsit");
				break;
				case "erro_psw":
				alert("wrong password");
				break;
				case "erro_lock":
				alert("the user was lock");
				break;
				case "suc":
				//alert("access login");
			//top.window.location = '../Vote/Vote_manage.asp'; 
				location.href="../Vote/Vote_manage.asp";
				break;
				default:
				alert("servers out of work");
				}
			}
		}
	xmlhttp.send(null);
	}
	return false;
}
ASP:
Code:
if psw<>Rs("PassWord")then
				response.Write("erro_psw")
				response.End()
			else
				if Rs("lock") = 1 then
				response.Write("erro_lock")
				response.End()
				end if
				session("admin_name") = username
				If AutoGet <>"" Then
					
					Response.Cookies("MyCMSCookie")("AdminName")=Session("admin_name")
					
					Response.Cookies("MyCMSCookie").Expires=Date()+365
				Else
					Response.Cookies("MyCMSCookie")("AdminName")=""
					Response.Cookies("MyCMSCookie").Expires=Date()-1
				End If
				rs_u = conn.execute("update admin set LoginNum=LoginNum+1 where UserName='"&username&"'")	
				response.Write("suc")
			end if
		else
			response.Write("erro_username")
			response.End()
		end if
HTML
Code:
<form name="login" method="post">
<button  value="登 录" onClick="CheckForm();return false;">登 录</button>
leoz2z is offline   Reply With Quote
Old 12-12-2007, 08:45 AM   PM User | #2
leoz2z
New to the CF scene

 
Join Date: Dec 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
leoz2z is an unknown quantity at this point
I know the reason now
because
if(xmlhttp.readystate == 4 && xmlhttp.status ==200)
must be
if(xmlhttp.readyState == 4 && xmlhttp.status ==200)
FF is more strict than IE
leoz2z is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:40 PM.


Advertisement
Log in to turn off these ads.