> i cant quite figure this out
> what would be the best way to do this

There are a couple of options off the top of my head.

One would be to create a checkSubscription() method that would return a
boolean value depending on whether the e-mail address was subscribed.  If it
is, call the unsubscribe method.  If not, display your error.  This is
probably the better choice.  You can re-use the checkSubscription() method
when someone tries to join the list so it will not add a duplicate, for
example.

The other method would be to use your existing code, but prepend a bit value
to the front of your return value.  Example:

<cfset result="0,Not found in database.">
<cfset result="1,You have been unsubscribed.">

After calling the method, you can check the bit value using
listFirst(unSubscriber) to determine if it was successful, and perform
whatever action was needed.  Then you can listRest(unSubscriber) to
display/extract your error message.


-Justin Scott


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222690
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to