WHOIS Search
I have seen many WHOIS tags that are hard to figure out or couldn't get them to work. I decided to then make my own that is simple to make and to configure.


<center>
  <cfparam name = "form.domain" default = "xp-resources">
  <cfparam name =
"form.ext" default = ".com">
  <cfparam name =
"action" default = "none">

  <!--- Determines if the form was submitted --->
  <cfif action is "find">
    <!--- This gets the info --->
    <cfhttp url="http://reports.internic.net/cgi-bin/whois?whois_nic=#form.domain##form.ext#&type=domain"
               method=
"GET"
               resolveurl=
"yes"
               throwonerror=
"yes">
     </cfhttp>
     <cfset startat = find(
"<pre>", cfhttp.filecontent, 1)>
     <cfset endat = find(
"</pre>", cfhttp.filecontent, startat)>
     <cfset info_length = int(endat - startat)>
     <cfset info_on = mid(cfhttp.filecontent, startat, info_length)>
     <cfset registered = find("No match for domain", info_on, 1)>


     <cfoutput>
        <!--- This will determine if the domain is registered --->
        <cfif registered neq 0>
            The domain "#form.domain##form.ext#" is available! <br>
        <cfelse>
            The domain "#form.domain##form.ext#" is already registered. <br>
            <br>
            <!--- Shows the results --->
            #info_on# 
        </cfif>
        <br>
    </cfoutput>
  <cfelse>

    <!--- Form for the search --->
    <form method="post" action="#script_name#?action=find">
        Enter Domain: <br>
        <font size="1"> <b>http://www.</b>
        <input type="text" name="domain">
        <select name="ext">
            <option>.com</option>
            <option>.net</option>
            <option>.edu</option>
        </select>
        <input type=
"submit" value="Search">
    </form>

  </cfif>
</center>

Well, there you go. Easy, little code for a simple WHOIS search.
Questions, comments, or anything else, please contact Drew Tempelmeyer
All ColdFusion Tutorials By Author: Drew Tempelmeyer
  • Shout Box [LIVE]!
    Ever want a place where people can chat or post their opinions? Ever heard of a shout box? This tutorial will give you an easy example of having a shout box on your site.
    Author: Drew Tempelmeyer
    Views: 29,758
    Posted Date: Saturday, February 22, 2003
  • WHOIS Search
    This will show you how to make a simple WHOIS search that can be easily added to any site.
    Author: Drew Tempelmeyer
    Views: 17,945
    Posted Date: Sunday, April 27, 2003
  • 9 Day Weather Forecast
    This will retrieve the 9 day weather forecast for the specified ZIP code.
    Author: Drew Tempelmeyer
    Views: 27,072
    Posted Date: Friday, May 16, 2003
  • Parsing XML With ColdFusion MX
    Want to know how to parse XML with ColdFusion with ease and very basic concepts? Then this is the tutorial for you.
    Author: Drew Tempelmeyer
    Views: 41,220
    Posted Date: Sunday, November 9, 2003
  • Creating Static HTML Pages from Dynamic Pages
    Static HTML can help reduce the load on the server. This helps resources be used for other things that you may possibly need. Creating static HTML in ColdFusion is a simple task and can simply be done by following this tutorial.
    Author: Drew Tempelmeyer
    Views: 20,677
    Posted Date: Thursday, March 31, 2005
Download the EasyCFM.COM Browser Toolbar!