473,395 Members | 1,631 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,395 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 2429
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.