Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Passing username & password to login.asp
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

shfoo
Starting Member

6 Posts

Posted - 19 November 2003 :  03:34:56  Show Profile
I create a page outside the forum and try to pass the user name & password to the login.asp page.

<%
UserName = "user1"
Password = "puser2"

%>

<A HREF="#" onClick=login_onclick()>GO TO FORUM</A>

<form name="form1" action="../forum/login.asp" method="POST">
<input type=hidden name="Name" value="<%=UserName%>">
<input type=hidden name="Password" value="<%=Password%>">
</form>

<script language="vbscript">
sub login_onclick()
document.form1.submit
end sub
</script>



I have hard-coded the name & password here just for demo purposes and asumming that this name & pw are both correct.
It works when it's not already login. However, once I change the name & password to something else, the login still pick up the previous login name & password .

I know I'll have to remove the cookies so the login.asp will treat this as a new login but not sure how to do it.

Anyone can help??






Edited by - shfoo on 19 November 2003 03:37:25

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 November 2003 :  04:14:54  Show Profile  Visit HuwR's Homepage

select case Request.Form("Method_Type")
	case "login"
		strEncodedPassword = sha256("" & Request.Form("Password"))
		select case chkUser(strDBNTFUserName, strEncodedPassword,-1)
			case 1, 2, 3, 4
				Call DoCookies(Request.Form("SavePassword"))
				strLoginStatus = 1
			case else
				strLoginStatus = 0
			end select
	case "logout"
		Call ClearCookies()
end select


As used in the forum header
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 November 2003 :  10:12:50  Show Profile  Visit dayve's Homepage
quote:
Originally posted by shfoo


<script language="vbscript">
sub login_onclick()
document.form1.submit
end sub
</script>


This will only work in Internet Explorer. I would suggest that you not use client side VBScript in your web projects.

Go to Top of Page

shfoo
Starting Member

6 Posts

Posted - 19 November 2003 :  21:28:24  Show Profile
Thanks. Seems like it works. I'll have to pass two more variables across.

<input type=hidden name="Method_Type" value="login">
<input type=hidden name="SavePassword" value="true">

But I receive this message:
You logged on Successfully.
Thank you for your participation

and I'm back to the page I came from.
I remove the "Refresh" portion of the code and replace with Response.Redirect("default.asp") from inc_header.asp. And finally it works and I'm now a happy man.

Thanks HuwR & dayve for your help. It's time to change to JavaScript.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07