RE: variable does not exist

2000-08-10 Thread Lon Lentz


  cfparam name="session.user" default=""
  !--- then put ---
  cfif '#Session.User#' IS ""
cflocation url="login.cfm"
  /cfif

Lon Lentz
Applications Developer - Alvion Technologies
DataWarehousing and List Sales - Market Your Lists on the Net!
[EMAIL PROTECTED]
941-574-8600 Ext. 210

-Original Message-
From: Jamie Symonds [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 10, 2000 9:53 AM
To: [EMAIL PROTECTED]
Subject: "variable does not exist"

This is secure.cfm:
!--- User has yet to login ---
cfif '#Session.User#' IS ""
cflocation url="login.cfm"
/cfif

Is there a way that I can say [if variable Session.User does
not exisit, create Session.User with value ""]?  This would
default to login.cfm?

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: variable does not exist

2000-08-10 Thread Philip Arnold - ASP

 I have a
 cfinclude template="secure.cfm"
 at the top of my cfm templates.

 This is secure.cfm:
 !--- User has yet to login ---
 cfif '#Session.User#' IS ""
 cflocation url="login.cfm"
 /cfif

 The small secure app that I've been using is working well,
 except for when the variable Session.User does not exist -
 for example, I have a page called info.cfm (with the
 cfinclude for secure.cfm) - If I load up my browser, enter
 the URL and file name (info.cfm), I would like for it to
 default to login.cfm and prompt for a login, not display an
 error message (The session variable USER does not exist.)  I
 also get the same when the session times out.

 Is there a way that I can say [if variable Session.User does
 not exisit, create Session.User with value ""]?  This would
 default to login.cfm?

CFParam the variable or use isDefined()

Also, don't put cfif '#Session.User#' IS "", put cfif Session.User IS ""
Otherwise you're forcing CF to put the variable into a string, which means
you should work out things like balancing the apostrophies

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.