View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
The variable name in the SetVar and GetVar methods must be passed as a string.  If you want your variable to be called pUserID then you must use Session.SetVar('pUserID', pUser) to store your value and Session.GetVar('pUserID') to retrieve it.

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 05/31/2002 11:04:15 PM:

Hello. I am having a hard problem setting a variable so I can capture it later and query a table. Here is the code using FoxWeb authenicate code to log in the user:

ClientLogin.FWX

      CASE Auth.NewLogin
       SET CENTURY ON
       IF USED('clients')
        SELECT clients
        USE
       ENDIF
       USE pbs!clients IN 0
       SELECT CLIENTS
       LOCATE FOR clients.userID = Auth.UserID
       pUser = ""
       pUserID = ""
       pUser = clients.clientid && unique client ID
       Session.SetVar(pUserID,pUser) && save unique id to var pUserID
       USE
       Response.Redirect("http://localhost/pbs/clienthome.fwx")

clienthome.fwx

<%
lcClientID = Session.GetVar(pUserID) && Error Here - Can't find var pUserID
USE c:\inetpub\wwwroot\data\pbs!vClientProfile NODATA SHARED IN 0  && local view
SELECT vClientProfile  && Select view
vClientID = lcClientID  && set value for parameratized view
=REQUERY()  && fetch record
%>

What am I doing wrong setting and getting a session variable?

Joe