Ricardo Silva
|
Posted: 01/14/2004, 10:26 AM |
|
Hi!
I have one question to post to all of you in order to try to get an answer.
I want to have a login form for the registered users access to the data of a
database. So, I inserted a search form with the login and the password
fields. I can achieve my goals with that form, passing the login and the
password field in the URL. But I don't want to do that. Instead, I want to
pass the User_ID and the Code fields in the URL. Is that possible?
Summarizing what I want to do:
1. User enters Login and Password;
2. The form finds the record matching the Login and Password fields;
3. The form retrieves the User_ID and the Code fields from that specific
record;
4. The form send the user to whatever.asp page with the "User_ID=&Code="
parameters in the URL.
On this way, the Login and the Password files wouldn't be displayed in the
URL. The first 2 steps are achieved by a CCS search form. And how about the
3rd step? How can it be done?
Please give me a hand on this! Thanks in advance.
Best regards,
Ricardo
|
|
|
Oper
Posts: 1195
|
Posted: 01/13/2004, 6:33 PM |
|
use ccgeturerid()
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
Ricardo Silva
|
Posted: 01/20/2004, 1:10 AM |
|
Mr. Oper,
How do I use that? Sorry, but I didn't understand how should I use
CCGETUSERID(). In an event, in the ASP page, in the HTML, where?
User enters "LOGIN" and "PASSWORD" fields. I want to retrieve from the DB
the record that match those fields and get the "ID" and the "CODE" fields in
order to pass them to the URL instead of the "LOGIN" and "PASSWORD" fields.
Best regards,
Ricardo
|
|
|
peterr
Posts: 5971
|
Posted: 01/20/2004, 1:40 AM |
|
I'm not sure if you want to do this when users actually login, or on another non-login form.
In any case, use the code below in the Server OnClick event, which should work in both the Login and standard Search forms:
Redirect = "PageName.asp?User_ID=" & CCGetUserID & "&Code=" & CCDLookup("code","users","user_id=" & Session("UserID"),DBConnection1)
Of course you will need to adjust the variables above to match your own data.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Ricardo Silva
|
Posted: 01/21/2004, 4:31 AM |
|
I Peter!
I am really sorry, but it didn't work. I don't know if I did it right, but I
tried several ways without success. So, I will quote the code that I
inserted in the Login form (a Search form) which I intend to use for users
to login. I inserted it in the Login Button (a submit button with validation
enabled -- you didn't mention where should I insert the Server enClick
event, so I assumed that it would be there):
Redirect = "Eve_Register1.asp?ID=" & CCGetUserID & "&Code=" &
CCDLookup("Code","Organizations","ID=" & Session("UserID"),DBEvents)
where:
- "Eve_Register1.asp" is the page where I want to send the user without the
s_Login and the s_Password fields in the URL;
- "ID" is the table key field;
- "Code" is the unique field that will identify and restrict the user
access;
- "Organizations" is the table where the "ID" key-field, the "Login", the
"Password" and the "Code" fields are located;
- "Events" is the name of the CCS connection to the database.
I didn't fill in the CONNECTION and DATA SOURCE properties of the
Login-form. Should I?
You can check the page running at http://www.promulgatio.com/Eve_Login.asp.
On this way, you will be able to better understand what am I talking to. And
the GENERAL IDEA is not pass into the URL the Login and Password fields in
order to search for the right record because they would be visible for
indiscrete eyes...
Where did I go wrong in the insertion of the code you sent me?
Thank your for your kind help and support.
Best regards,
Ricardo
|
|
|
Al
|
Posted: 01/21/2004, 6:30 AM |
|
Hi Ricardo.
You don't need to add the user_id in the redirect page.
Just set the "Eve_Register1.ccp" in the Return page property of the login form.
If user enter the real login and password he will be redirected to the
Eve_Register1.ccp.
And you can get user ID and login of the logged in user in the any page of your project
Use CCGetUserID() and CCGetUserLogin() in the custom code
or if you want to use user_id in the grid where parameter,
use "Parameter Source" UserID with Session type.
B.r.
Al
|
|
|
|