473,666 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("u Name");
//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.Cre ateObject("ADOD B.Connection");
rs=Server.Creat eObject("ADODB. Recordset");
conn.Open("cpWe bdata");

sSQL = "SELECT InvestorAdmin.* ";
sSQL += " FROM InvestorAdmin ";
sSQL += " WHERE MemberID = '" + Request.Form("u Name") + "' ";
sSQL += " AND MemberPW = '" + Request.Form("u Pass") + "';";
rs=Server.Creat eObject("ADODB. Recordset");
rs.Open(sSQL, conn);
//Response.write( sSQL); THIS RETURNS MemberID='undef ined'

if (!rs.eof) {
//User Validated as a record exists in recordset
var memid;
memid = Request.form("u Name");
//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=JavaSc ript>window.loc ation =
\"loginportfoli o.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 2446
Two things that I noticed immediately.
1) Shouldn't it be Language=Javasc ript 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**@mirandajo hnsen.com> wrote in message
news:um******** ******@TK2MSFTN GP11.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("u Name");
//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.Cre ateObject("ADOD B.Connection");
rs=Server.Creat eObject("ADODB. Recordset");
conn.Open("cpWe bdata");

sSQL = "SELECT InvestorAdmin.* ";
sSQL += " FROM InvestorAdmin ";
sSQL += " WHERE MemberID = '" + Request.Form("u Name") + "' ";
sSQL += " AND MemberPW = '" + Request.Form("u Pass") + "';";
rs=Server.Creat eObject("ADODB. Recordset");
rs.Open(sSQL, conn);
//Response.write( sSQL); THIS RETURNS MemberID='undef ined'

if (!rs.eof) {
//User Validated as a record exists in recordset
var memid;
memid = Request.form("u Name");
//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=JavaSc ript>window.loc ation =
\"loginportfoli o.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=+memi d\";
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=Javasc ript>window.loc ation=\"../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=Javasc ript>window.loc ation=\"../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=Javasc ript>window.loc ation=\"../clientside/clientnewstest1 .asp?
memberid=" + memid + "\";</script>");

Easier still.....

<script language=Javasc ript>

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

whoops, cut&paste error there :+s

So, This area is the main prob: ?memberid=+memi d\";
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=Javasc ript>window.loc ation=\"../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
5938
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 contains: <?php $_SESSION = ""; $_SESSION = "";
1
7780
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: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
3
2075
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 to get a working system just about finished. I am building an interface for our customer service folks to use to manage registered customers and am seeing some weird behavior.
0
8754
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 for a Crystal Report. The method has a single argument which represents a parameter required by the Stored Procedure. When I generate the report in Crystal and run it using the class I built, it works fine. I've tried it with parameters and...
12
2218
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 reccount FROM Equipmenttbl " sql01 = sql01 & "WHERE Equipmenttbl.GrantID = " & GrantID
3
2589
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 directly, through a local web server and through a remote web server. By turning cookies on/off in your browser, running the file, then clicking the 'test1' or 'test2' buttons, the displayed text should accurately inform you if your cookies are On or...
1
3592
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 tutorial to help me with this issue I figured I'd make a post just in case someone else runs into the same issue. ....
14
7071
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" action="<%=request.servervariables("Script_name") %>" <% for i - 0 to 4%> Header: <input type="text" name="header" id="header<%=i%>"
2
1865
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 keyed value in key.jsp text box should be returened to login.jsp in corresponding to the button clicked.(ie if user clicked useridtext box key board button then the value in key.jsp should be placed or if user clicked the pwd text keyboard button...
0
8785
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5671
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.