473,243 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,243 software developers and data experts.

Passing login values issue ??? test1.asp?name =value???

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 2426
Two things that I noticed immediately.
1) Shouldn't it be Language=Javascript rather than
Language=../clientside/etc.
2) memid needs to be outside of the quotes if you wish to concatenate it's
value.
Response.write ("yada yada yada" + memid);
"Miranda johnsen" <in**@mirandajohnsen.com> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
Thanks Tom,

whoops, cut&paste error there :+s

So, This area is the main prob: ?memberid=+memid\";
I'm not sure what you mean about the quotes???
This is a slight re-write of what I thought I pasted in :+s
Response.write("<script
language=Javascript>window.location=\"../clientside/clientnewstest1.asp?
memberid=+memid\";</script>");

Thanks, MJ


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Sorry I haven't got back sooner.
Response.Write("the text to be written"); is the format for
Response.Write --- as you know.
The engine will write whatever's in quotes as is. Therefore, to send the
value of a variable, it needs to be appended outside of the quotes....

Response.Write("Hello" + fName); Where fName is a variable containing the
value you want sent..

So in your code
Response.write("<script
language=Javascript>window.location=\"../clientside/clientnewstest1.asp?
memberid=+memid\";</script>");

memid - a variable - is within the quotes of
Response.write("<SCRIPT...........+memid\";</SCRIPT>");
Where I think it should be......
Response.write("<script
language=Javascript>window.location=\"../clientside/clientnewstest1.asp?
memberid=" + memid + "\";</script>");

Easier still.....

<script language=Javascript>

window.location="../clientside/clientnewstest1.asp?memberid=<%Response.Write
(memid);%>";
</script>
"Miranda johnsen" <in**@mirandajohnsen.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
Thanks Tom,

whoops, cut&paste error there :+s

So, This area is the main prob: ?memberid=+memid\";
I'm not sure what you mean about the quotes???
This is a slight re-write of what I thought I pasted in :+s
Response.write("<script
language=Javascript>window.location=\"../clientside/clientnewstest1.asp?
memberid=+memid\";</script>");

Thanks, MJ


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
0
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
12
by: Jack | last post by:
Since, I have not got some desired advise, I am reposting this for some asnwer/valuable suggestion. Thanks. THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS...
3
by: WayneH | last post by:
Hi - I'm trying to use javascript to determine if a user's browser has cookies enabled or not. To test: copy this code into a file with a 'html' extension, and load it into your IE browser...
1
by: Wayne Deleersnyder | last post by:
Hi All, I was going to write and ask if someone could help me fix the formatting of my output for hash values, but I believe I got it right now. But, because I couldn't find any website or...
14
by: Adrienne Boswell | last post by:
Although this is a client side issue, I am also posting to asp.general in case there is someway to do this only server side (which I would prefer). Here's my form: <form method="post"...
2
by: bytesbytes | last post by:
JSP Scenario: Login page containing user id and pwd text boxes, each having a key boad button (onclicking the key board button will take to key.jsp where the user can input values in text box) The...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.