Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2008, 10:07 AM
Authorized User
 
Join Date: Jan 2008
Location: Suwanee, GA, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help passing login info to new page

Hello, I'm trying to set up our login page so that when they login, they can click a link to a third-party website, which will automatically log them in using login info from our database.

ANY advice or pointers would be great.

Thanks.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
__________________
Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
Reply With Quote
  #2 (permalink)  
Old January 7th, 2008, 10:37 AM
Authorized User
 
Join Date: Jan 2008
Location: Suwanee, GA, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Need help.
=[

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
Reply With Quote
  #3 (permalink)  
Old January 7th, 2008, 12:09 PM
Authorized User
 
Join Date: Jan 2008
Location: Suwanee, GA, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Figured it out.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
Reply With Quote
  #4 (permalink)  
Old January 7th, 2008, 06:33 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Your solution may be useful to others...

Wind is your friend
Matt
Reply With Quote
  #5 (permalink)  
Old January 10th, 2008, 12:39 PM
Authorized User
 
Join Date: Jan 2008
Location: Suwanee, GA, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, it turns out that the vendor wanted to simply pass the login info in the querystring, figuring it's safe enough since you need to be logged in prior anyway.

When a user logs in, all their user info is stored into session, and on the next page after a successful login(inside_home.asp), there is a link calling a javascript function to post to the vendor.
i.e.
Code:
<a href='http://www.securedata-trans5.com/ap/ap_admin_v2/admin_v2.php' onClick='JavaScript:AppointmentPlusLogin();return false;' target=_top>blah blah</a>
the javascript function is simply
Code:
function AppointmentPlusLogin() {
window.location.href = document.form1.submit();
VBScript
Code:
<%          
        Set dc = Server.CreateObject("ADODB.Connection")
        dc.ConnectionTimeout = Session("dc_ConnectionTimeout")
        dc.CommandTimeout = Session("dc_CommandTimeout")
        dc.Open Session("dc_ConnectionString"), Session("dc_RuntimeUserName"), Session("dc_RuntimePassword")
        Set cmdTemp = Server.CreateObject("ADODB.Command")
        Set dcUser = Server.CreateObject("ADODB.Recordset")
        cmdTemp.CommandText = "SELECT * FROM login LEFT JOIN person ON login.login_id = person.login_id WHERE (person.person_id = " & Session("person_id") & ") AND person.hide_record <> 1"
        cmdTemp.CommandType = 1
        Set cmdTemp.ActiveConnection = dc
        dcUser.Open cmdTemp, , 0, 1

        dim pw
        pw = dcUser("last_name")

        dim pw2
        pw2 = trim(left(pw,3))

            dcUser.Close
            Set cmdTemp = Nothing
            Set dcUser = Nothing
            dc.Close
            Set dc = Nothing


%>
And here's the form telling the javascript function AppointmentPlusLogin what to do.
Code:
<form name="form1" id="form1" method="post" action="http://www.vendor.com/admin_v2.php?action=log_in&login=<%= pw %>&password=<%= pw2 & Session("login_name") %>">

</form>
Please note that I don't recommend passing login info through the querystring if it can be avoided.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing session variables from login page. captainzorro Classic ASP Components 1 April 23rd, 2008 11:54 PM
Grabbing user login info Quick209 ASP.NET 2.0 Basics 1 May 12th, 2006 07:06 PM
Passing CR Login info in a ASP.NET app. billbeecher@cox.net BOOK: Professional Crystal Reports for VS.NET 0 March 31st, 2005 10:23 PM
Passing NT Login Info negrette Classic ASP Professional 1 October 25th, 2004 02:37 PM
Passing logon info sandeep Crystal Reports 1 October 6th, 2004 08:41 AM



All times are GMT -4. The time now is 01:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.