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 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing Information

    need to pass a value from a form from one page to another. The form in
    question takes the username and password than will log go into the confo
    page. I need to grab the username becuase on the confo page, it needs that
    username to give a list of options on where they can go next.

    How can i get that form info, (and if it is valid) use that same info on a
    seperate page?

    tried that here is my code:

    Login page

    If Request.Form("valuepassed") ="true" Then
    CheckLoginForm
    Else
    ShowLoginForm
    End If

    Sub CheckLoginForm
    Dim myconn, blnLoggedIn, strplace, strname
    Set myconn = Server.CreateObject("ADODB.Connection")
    myconn.open = "not needed here"

    strname = Request.Form("uname")
    strplace = Request.Form("place")


    myconn.execute("UPDATE verify set logged = (logged + 1) , lastlogged =
    '" & Now() & "' , place = '" & strplace & "' WHERE name='" & strname & "';")
    Response.Redirect "http://www.mydomain.com/confo.asp"

    myconn.close
    set myconn = nothing

    ShowLoginForm
    End Sub
    %>

    <form name="form" action="index.asp" method="post">

    blah blah.




    CONFO PAGE


    Dim myconn, objRS, ecom, strplace
    Set myconn = Server.CreateObject("ADODB.Connection")

    yep= 1

    strplace = Request.Form("place")

    Set objRS = myconn.execute("SELECT place FROM verify WHERE name='" &
    strplace & "';")

    If objRS("place") = yep Then
    Response.write "GO HERE"

    Else
    Response.write "go here"

    objRS.Close
    Set objRS= Nothing

    myconn.close
    set myconn = nothing
    End If
    %>

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    2 options
    1)use Session variables
    Session("name") = strName


    2) use a querystring
    a querystring would look like this
    Code:
    Response.Redirect "http://www.mydomain.com/confo.asp?name=" & strName 
    
    
    Now on the confo.asp you need to change the code to reflect that 
    you are getting the information from a string
    
    'prefered method
    strName = Request.Querystring("name")
    'you can also use 
    'strName = Request("name")

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks that made it work!


  •  

    Posting Permissions

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