Hi Philip,

The script you're trying to connect to requires a session to be established
before it will send you the right information.. Unfortunately, this means
making 2 requests; one to initiate the session and capture session data, and
the second to go get your data.

The code below will do the trick, but personally, I'd start looking at other
ways to host those Communities.. :)  The request latency overhead is going
to slow this thing waaay down; not anything you'd want to use live.. Maybe
for taking a snapshot once a day or something, but even that isn't really
what <cfhttp> was designed for...

I'd look into using Allaire Forums.  You'll have to do some, er,
"polishing", but the code wil be yours, the content will be yours, and it's
free..  Actually, I think these guys have a pre-fixed version you can snag
for free:
http://www.forumspot.org/

Oh yeah.. Almost forgot the code.. :)

Also, you can tell if a server is sending cookies by outputting
#cfhttp.header# after a cfhttp.  This is a great tool that I think is
underutilized by people working with cfhttp..

<!--- Hit the server to get the cookie --->
<cfhttp
        method="get"

url="http://expatonline.community.everyone.net/commun_v3/scripts/directory.p
l"
        resolveurl="no"
        redirect="no">

<!--- Get the value of the cookie from the response headers --->
<cfset CookieResponse = CFHTTP.RESPONSEHEADER["SET-COOKIE"]>

<!--- Get the first part of the cookie (that's all we need - just the
value --->
<cfset CookieValue = ListGetAt(CookieResponse, 1, ";")>

<!--- Knock off the cookie label, just keep the good stuff. --->
<cfset SessionID = ListGetAt(CookieValue, 2, "=")>

<!--- Now go get the page we're after, providing the server with the cookie.
Notice
        that we are using the "post" method here.  We have to do that in order to
send
        the cookie information. --->
<cfhttp
 method="post"

url="http://expatonline.community.everyone.net/commun_v3/scripts/directory.p
l"
 resolveurl="yes">
 <cfhttpparam type="cookie" name="EONS2" value="#SessionID#">
</cfhttp>

<!--- Umm, spit it out, of course! --->
<cfoutput>
#CFHTTP.FileContent#
</cfoutput>

Best Regards,

Seth

------------------------------
Seth Bienek
Solutions Development Manager
Stonebridge Technologies, Inc.
972.455.7294 tel
972.404.9754 fax
ICQ #7673959
------------------------------

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Philip Humeniuk
> Sent: Friday, March 30, 2001 6:32 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: CFHTTP
>
>
>
> I tried the below code with the "resolve" and it still won't work
> yet if I
> enter in any other url it works for example www.adobe.com.
>
>
>
> <cfhttp method="get"
> url="http://expatonline.community.everyone.net/commun_v3/scripts/d
> irectory.pl">
>
> <cfoutput>
> #CFHTTP.FileContent#
> </cfoutput>



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to