...

View Full Version : Passing Information



Athmaus
08-23-2004, 07:20 PM
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
%>

miranda
08-24-2004, 12:24 AM
2 options
1)use Session variables
Session("name") = strName


2) use a querystring
a querystring would look like this


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")

Athmaus
08-24-2004, 12:31 AM
thanks that made it work! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum