Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Session variable from vfp in ASP
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Session variable from vfp in ASP
Miscellaneous
Thread ID:
01133662
Message ID:
01133662
Views:
135
hi all,
I have an asp web app that has stopped working properly. It used to check a username and password and then set two session variables that went with the pages so you could see at th etop of pages "hello MARK from KERNEL SOFTWARE". I have even put in some code SESSION("MARK1") = "HELLO" and then tried to view that on the next page but that didn't work either. I have included all of the relevant code below in case there is some session clearout command that i am using.
< % @Language=VBScript% >
< % Option Explicit % >
< %
Session.Timeout=1
% >
<!--#include file="adovbs.inc"-->
<!--#include file="connection.asp"-->
< %

Dim de_usrnam, de_paswrd
de_usrnam=ucase(trim(request.form("de_usrnam")))
de_paswrd=ucase(trim(request.form("de_pwrd")))

Dim ag_RS, ag_SQL, wheretogo, de_type
de_type = "AGENT"
Set ag_RS = Server.CreateObject("ADODB.Recordset")

' Run the select command to verify the password
ag_sql = "SELECT * FROM agpeople WHERE upper(p_code) = '" & de_usrnam & "' AND upper(p_string) ='" & de_paswrd &"' AND p_type ='" & de_type &"'"
Set ag_RS = objConn.Execute(ag_sql)

If NOT ag_RS.EOF Then
	SESSION("USERCODE") = ag_RS("p_code")
	SESSION("USERNAME") = ag_RS("p_name")
	
	' get the agent name
	Dim ag3_SQL, ag3_RS, agentref
	agentref = ag_RS("p_mcode")
	ag3_SQL = "SELECT ref, name FROM KFSMA WHERE smau6 = 2 AND ref = '" & agentref & "'"
	
	Set ag3_RS = objConn4.Execute(ag3_SQL)
	
	If NOT ag3_RS.EOF Then
		SESSION("USERWORK") = ag3_RS("name")
	Else
		SESSION("USERWORK") = "NOT FOUND"
	End If
	
	
	ag3_RS.Close
	Set ag3_RS = Nothing
	
	ag_RS.Close
	Set ag_RS = Nothing
	
	objConn.Close
	Set objConn = Nothing
	
	response.redirect ("agent.asp")
and here is the resulting web page that user to show the session variables in SESSION("USERWORK") and SESSION("USERNAME")
< % @Language=VBScript % >
< % Option Explicit % >
< % ' Making sure that the Admin user is logged in
'If Session("Role") <> "BROKER" Then 
'	'Response.redirect ("userlogin.asp?timeout=1") 
'End If

'Session.Timeout=10
% >
<!--#include file="adovbs.inc"-->
<!--#include file="connection.asp"-->
<html>
<head>

<title>Webpage title</title>

<link href="css/text.css" rel="stylesheet" type="text/css">
<link href="css/dnl.css" rel="stylesheet" type="text/css">


</head>

<body>
<TABLE cellSpacing=0 cellPadding=0 width=800 border=0 align="center">
	<TR>
		<TD width="800" align="left" class="bodytext">
             Welcome <b>< %=SESSION("USERNAME")% ></b> from <b>< %=SESSION("USERWORK")% ></b>
		</TD>
	</TR>
Go raibh maith agat

~M
Next
Reply
Map
View

Click here to load this message in the networking platform