Thanks Jerry,
Does this seem correct?
<!--- Begin DateCompare --->
<!--- Compare signupdate with todays date to see if its been 30 days
--->
<cfset j=dateCompare(dateAdd("d",30,signupdate),now())>
<cfif j eq -1>
<!--- if Not expired let them in --->
<cflocation url="login.cfm">
<cfelseif j eq 0>
<!--- if Last day, redirect them to last day login page --->
<cflocation url="lastDay_login.cfm">
<cfelseif j eq 1>
<!--- if expired redirect them to expiration page --->
<cflocation url="membership_expired.cfm">
<!--- check to see if signupdate is null --->
<cfelseif SignUpDate "">
<!--- if null then they are a paid member with full access,
redirect to login --->
<cflocation url="login.cfm">
</cfif>
-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 04, 2005 3:13 PM
To: CF-Community
Subject: Re: What am I doing wrong with this DATECOMPARE?
Your error is here:
<cfif (SignUpDate + #DateFormat(Now())#) GTE 30 >
You are going to want to use the dateCompare function. Or maybe the
dateAdd function. Or both.
<cfset j=dateCompare(dateAdd("d",30,signupdate),now())>
<cfif j eq -1>
Not expired
<cfelseif j eq 0>
Last day
<cfelseif j eq 1>
expired
</cfif>
Jerry Johnson
Web Developer
Dolan Media Company
>>> [EMAIL PROTECTED] 01/04/05 03:11PM >>>
I have a members only section that allows 30 day guest pass. When
logging in, I need to check to see if user is a registered member or a
registered visitor on a 30 day pass and to redirect them if 30 days has
expired. What am I doing wrong?
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:5:141530
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54