M
Miranda johnsen
Hello,
I need some help with passing a value from my login authorization page.
The authorization is done with the code below (it works), but I need the
'uName' value passed on when the window.location is activated.
I code my ASP with JavaScript NOT vbscript so please no &'s. And yes I
know I should be using a DSN-less connection! ((sorry, everytime I post
I get blasted about my syntax and connection choice :+))
I am slightly baffled with query's and this is what I have tried:
============= taken from code below ==================
var memid;
memid = Request.form("uName");
//Response.write(memid);//THIS PRINTS OUT FINE!!!
Response.write("<SCRIPT
Language=\"../clientside/clientnewstest1.asp?MemberID=+memid\";</SCRIPT>
");//THIS DOES NOT!!
=============================================
==========================================
======== THE WHOLE SECTION ==========
==========================================
var conn;
var rs;
var sSQL;
conn=Server.CreateObject("ADODB.Connection");
rs=Server.CreateObject("ADODB.Recordset");
conn.Open("cpWebdata");
sSQL = "SELECT InvestorAdmin.*";
sSQL += " FROM InvestorAdmin ";
sSQL += " WHERE MemberID = '" + Request.Form("uName") + "' ";
sSQL += " AND MemberPW = '" + Request.Form("uPass") + "';";
rs=Server.CreateObject("ADODB.Recordset");
rs.Open(sSQL, conn);
//Response.write(sSQL); THIS RETURNS MemberID='undefined'
if (!rs.eof) {
//User Validated as a record exists in recordset
var memid;
memid = Request.form("uName");
//Response.write(memid);
Response.write("<SCRIPT
Language=\"../clientside/clientnewstest1.asp?MemberID=+memid\";</SCRIPT>
");
} else {
//Not a valid username or password - THIS WORKS FINE
Response.write("<SCRIPT Language=JavaScript>window.location =
\"loginportfolio.asp\";</SCRIPT>");
rs.close();
conn.close();
rs=null;
conn=null;
}
=================================================
=============== END CODE ===================
===============================================
One more thing. My login page is used for two different databases - I
test for one, if false test for the other and if thats false they are
not allowed in. This works, but I just need that one value to go with
it!!
I would appreciate any help with this :+)
Thanks in advance, Miranda
I need some help with passing a value from my login authorization page.
The authorization is done with the code below (it works), but I need the
'uName' value passed on when the window.location is activated.
I code my ASP with JavaScript NOT vbscript so please no &'s. And yes I
know I should be using a DSN-less connection! ((sorry, everytime I post
I get blasted about my syntax and connection choice :+))
I am slightly baffled with query's and this is what I have tried:
============= taken from code below ==================
var memid;
memid = Request.form("uName");
//Response.write(memid);//THIS PRINTS OUT FINE!!!
Response.write("<SCRIPT
Language=\"../clientside/clientnewstest1.asp?MemberID=+memid\";</SCRIPT>
");//THIS DOES NOT!!
=============================================
==========================================
======== THE WHOLE SECTION ==========
==========================================
var conn;
var rs;
var sSQL;
conn=Server.CreateObject("ADODB.Connection");
rs=Server.CreateObject("ADODB.Recordset");
conn.Open("cpWebdata");
sSQL = "SELECT InvestorAdmin.*";
sSQL += " FROM InvestorAdmin ";
sSQL += " WHERE MemberID = '" + Request.Form("uName") + "' ";
sSQL += " AND MemberPW = '" + Request.Form("uPass") + "';";
rs=Server.CreateObject("ADODB.Recordset");
rs.Open(sSQL, conn);
//Response.write(sSQL); THIS RETURNS MemberID='undefined'
if (!rs.eof) {
//User Validated as a record exists in recordset
var memid;
memid = Request.form("uName");
//Response.write(memid);
Response.write("<SCRIPT
Language=\"../clientside/clientnewstest1.asp?MemberID=+memid\";</SCRIPT>
");
} else {
//Not a valid username or password - THIS WORKS FINE
Response.write("<SCRIPT Language=JavaScript>window.location =
\"loginportfolio.asp\";</SCRIPT>");
rs.close();
conn.close();
rs=null;
conn=null;
}
=================================================
=============== END CODE ===================
===============================================
One more thing. My login page is used for two different databases - I
test for one, if false test for the other and if thats false they are
not allowed in. This works, but I just need that one value to go with
it!!
I would appreciate any help with this :+)
Thanks in advance, Miranda