Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple Form actions in one page

    Ok, I am trying to modify a login page to use the username and password to run a stored procedure which returns the username and password for this specific application.

    username + pass > sproc > appusername + apppass

    So basically users don't have to remember multiple logins and can use one universal. I have this working, unfortunately, it is a 3 page process that requires multiple clicks.

    The first page they enter their known user+pass, click submit
    that passes the variables to a page that runs the sproc and returns the application specific user+pass and places them in HIDDEN textboxes. When they click submit again, it passes those to the actual login page where they must click submit yet again to enter the application.

    Is there a better way of doing this? I was able to make this all one page/process with ASP.NET but the application I am passing to is Classic ASP and they don't play nice togather with variables.

    Ideally, I'd like them to be able to enter their known username and password, click submit, which runs the sproc, returns the alternate credentials, and automatically POSTs those to the final page.

    Please forgive my complete ignorance of old school VB

  • #2
    New Coder
    Join Date
    Aug 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    why do you dont save the login in session variables?

    You have the login page, if login is correct you generate a Session variable like islogin = True.
    Then you have access to your applications.

    cheers

  • #3
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    you do not need to use multiple pages in classic asp. You can use sub procedures. Put each section into a different sub and call them individually just like you did in asp.net

  • #4
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cyberlord: Thanks, but the alternate ID is required to direct them to their account (so its not a yes/no situation). Good idea though

    miranda: That sounds perfect... Now my question is:
    What do I put in the form tag?
    <form name="login" action=" ??? " method="post" ID="Form1">
    In other words, how do I call the sub while passing the form variables to it.

    Thanks.

  • #5
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    there is only 1 form tag. That has
    action="<%=Request.ServerVariables("URL")%>" Now because Classic asp doesn't have a Page_Load event that you can use, you will need to look to see if the submit button was pressed. If not then the page is loading for the first time. If yes then the form was filled out and it is time to run the server side code. that may look like this

    the button's html
    <input type="submit" value="Submit" name="btnSubmit">

    in the code
    Code:
    <%
    If Len(Request.Form("btnSubmit")) > 0 Then
      ' the button was submitted call your sub procedures 
    Else
      'the button wasn't submitted 
      'Call showForm()   'the sub procedure that shows the form
    End If
    %>

  • #6
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a bunch.
    That worked out great and that's one less thorn in my side, and one more nugget of information.

  • #7
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Glad to help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •