<!--- Create an empty list variable
--->
<cfset domainlst = "">
<!--- loop over the query --->
<cfloop query="qEmail">
<!--- get the domain name from the
e-mail address --->
<cfset domain = ListGetAt(qEmail.Email,2,"@")>
<!--- if not in the list of domains,
add it --->
<cfif not ListFindNoCase(domainLst,domain)>
<cfset domainLst = ListAppend(domainLst,domain)>
</cfif>
</cfloop>
<cfoutput>
#ListLen(domainLst)#
</cfoutput>
Listing 2
<!--- Add the e-mail to the database
--->
<cfquery datasource="#request.dsn#">
INSERT INTO newsletter_subscribers (Email_Name,
Email_Domain)
VALUES ('#ListGetAt(form.Email,1,"@")#','#ListGetAt(form.Email,2,"@")#')
</cfquery>
Listing 3
<!--- Query shows how many users from
each domain --->
<cfquery name="qSubscribers" datasource="#request.dsn#">
SELECT Email_Domain, COUNT(Email_Name)
AS CountOfSubscribers
FROM newsletter_subscribers
GROUP BY Email_Domain
</cfquery>
Listing 4
<!--- Initial a Structure to hold the
return vars --->
<cfset ReturnVars = StructNew()>
<!--- loop over through the return string
to get the
variable/value pairs using "&" as
the delimiter --->
<cfloop list="#CFHTTP.FileContent#"
index="Item" delimiters="&">
<cfif ListLen(variables.Item,"=") gt
1>
<cfset varname = ListGetAt(variables.Item,1,"=")>
<cfset value = ListGetAt(variables.Item,2,"=")>
<cfset "ReturnVars.#variables.varname#"
= variables.value>
</cfif>
</cfloop>
<cfif IsDefined("ReturnVars.Status")>...