Peter,
You do this by using cfhttp as follows:
<cfhttp url="directory/myurl.cfm" method="POST" resolveurl="false">
</cfhttp>
<cfif cfhttp.filecontent does not contain "error" and cfhttp.filecontent
does not contain "connection">
<a href="directory/myurl.cfm">some link here</a>
</cfif>
The only problem is, for every link that needs to be checked, cfhttp will
take a while to check the page and thus slow down YOUR page that has the
links. CFHTTP is kind of slow. A better way to do this would be to
database all your links, then create a scheduled task that checks all the
links at once, maybe once a day or month or so, and and alters the database
as to whether or not each one has an error or connection failure. Then you
run a query against this database checking the status of each link the last
time it was checked and displaying it or not based on what it finds in the
database. If your links are already stored in a database, this will be easy
because you'll just have to add another bit field and call it "validlink" or
something.
-Craig Bowes
Coldfusion Programmer
[EMAIL PROTECTED]
972.243.1171
----- Original Message -----
From: "Peter Benoit" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, November 13, 2000 9:52 AM
Subject: cfhttp
> How can I use cfhttp if the page doesn't exist?
>
> I have a list of links, in case one doesn't exist anymore, I'd like to not
> present it. Is cfhttp the best way to do this?
>
> Thanks,
> Pete
>
> --------------------------------------------------------------------------
----------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send
a message with 'unsubscribe' in the body to
[EMAIL PROTECTED]
>
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]