cwhois Manual Copyright Vibralogix. All rights reserved.

Similar documents
Using Sitelok with WYSIWYG Web Builder

Using Sitelok with Webplus

SitelokTM. Stripe Plugin V1.5

Linklok URL TM V2.20

Sitelok Manual. Copyright Vibralogix. All rights reserved.

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018

Table of contents. Zip Processor 3.0 DMXzone.com

Fish Eye Menu DMXzone.com Fish Eye Menu Manual

PlayerLync Forms User Guide (MachForm)

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Outline. Introducing Form. Introducing Forms 2/21/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML

Form Processing in PHP

ITEC447 Web Projects CHAPTER 9 FORMS 1

COMS 359: Interactive Media

CAL 9-2: Café Soylent Green Chapter 12

Café Soylent Green Chapter 12

Spring 2014 Interim. HTML forms

Master Syndication Gateway V2. User's Manual. Copyright Bontrager Connection LLC

Hyperlinks, Tables, Forms and Frameworks

HTML Forms. By Jaroslav Mohapl

BuycPanel.com Licensing Addon Module v5.3

Manual for CKForms component Release 1.3.1

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

UNIT-VI CREATING AND USING FORMS

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

How to Make a Contact Us PAGE in Dreamweaver

Dynamic Product Options extension for Magento2. User Guide

Table of contents. Ajax AutoComplete Manual DMXzone.com

Taking Fireworks Template and Applying it to Dreamweaver

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Lava New Media s CMS. Documentation Page 1

Registration Fields Manager extension for Magento2. User Guide

Dreamweaver: Web Forms

External HTML E-form Guide

Written by Administrator Sunday, 05 October :58 - Last Updated Thursday, 30 October :36

Installing Dolphin on Your PC

Web Focused Programming With PHP

Creating and Building Websites

DAY 2. Creating Forms

Client Side Scripting. The Bookshop

Cascading style sheets

Linklok URL Manual. Copyright Vibralogix. All rights reserved.

Setting Up A WordPress Blog

By Ryan Stevenson. Guidebook #2 HTML

Resellers Guide Managing your Reseller Account

Forms, Form Events, and Validation. Bok, Jong Soon

Manual Html A Href Onclick Submit Button

Control Solutions i.candoit, i.board, and Babel Buster SP Web Server CGI Overview (2/2008)

USER MANUAL. SuiteCRM Customer Portal for Joomla TABLE OF CONTENTS. Version: 2.0

HTML Forms IT WS I - Lecture 11

Oracle Data Visualization SDK

PHP with MySQL: What you need to know Chapter 3. This section is on using PHP script tags appropriately in your PHP program.

Card Magic. Module for Miva Merchant. Introduction. Table of Contents

In this chapter then, you ll learn the following:

1 Form Basics CSC309

Using Dreamweaver CC. 5 More Page Editing. Bulleted and Numbered Lists

IEEM 230. PHP Basics, Part IV. Objectives of the lab:

Jquery Ajax Json Php Mysql Data Entry Example

HTML and JavaScript: Forms and Validation

CGI Programming. What is "CGI"?

Dreamweaver CS6. Table of Contents. Setting up a site in Dreamweaver! 2. Templates! 3. Using a Template! 3. Save the template! 4. Views!

CSE 154 LECTURE 8: FORMS

Table of content. Creating signup form Associating automation tools to signup form Signup form reports...42

Web API Lab. The next two deliverables you shall write yourself.

Using htmlarea & a Database to Maintain Content on a Website

By the end of this section of the practical, the students should be able to:

Creating Web Pages Using HTML

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

USER MANUAL. SuitePort - SuiteCRM Customer Portal for Joomla TABLE OF CONTENTS. Version: 1.1.0

Working Bootstrap Contact form with PHP and AJAX

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

USING DRUPAL. Hampshire College Website Editors Guide

BIS1523 Homework Assignments 2.1

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

BEGINNER PHP Table of Contents

Table Basics. The structure of an table

Sitelok Manual. Copyright Vibralogix. All rights reserved.

Quick Online Shop Documentation

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

Dynamic Product Options extension for Magento2. User Guide

HTML: Fragments, Frames, and Forms. Overview

Joomla 2.5 Flexi Contact Component Configuration

RC Justified Gallery User guide for version 3.2.X. Last modified: 06/09/2016

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next.

Adobe Dreamweaver CS5 Tutorial

Table of contents. DMXzone Universal Form Validator ASP DMXzone.com

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event

HTML crashcourse. general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button

Using Dreamweaver. 5 More Page Editing. Bulleted and Numbered Lists

Lab 4: Basic PHP Tutorial, Part 2

FolderView DMXzone.com Folder View 2 Manual

Databases HTML and PHP I. (GF Royle, N Spadaccini ) HTML/PHP I 1 / 28

Forms, CGI. Objectives

Dynamic Form Processing Tool Version 5.0 November 2014

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Q1. What is JavaScript?

JS Lab 1: (Due Thurs, April 27)

Things to note: Each week Xampp will need to be installed. Xampp is Windows software, similar software is available for Mac, called Mamp.

Transcription:

cwhoistm V2.12

cwhois Manual Copyright 2003-2015 Vibralogix. All rights reserved. This document is provided by Vibralogix for informational purposes only to licensed users of the cwhois product and is provided on an as is basis without any warranties expressed or implied. Information in this document is subject to change without notice and does not represent a commitment on the part of Vibralogix. The software described in this document is provided under a license agreement. The software may be used only in accordance with the terms of that license agreement. It is against the law to copy or use the software except as specifically allowed in the license. It is the users responsibility to ensure the suitability of cwhois before using it. In no circumstances will Vibralogix be responsible for any loss or damage of data or programs as a result of using cwhois. Your use of cwhois implies acceptance of these terms.

Contents Chapter 1 Introduction!... 4 What is cwhois!... 4 Chapter 2 Using cwhois with a form!... 5 Calling cwhois from a form!... 5 Quick Tutorial!... 6 Example forms!... 10 Changing the appearance of the results!... 12 Security!... 13 Chapter 3 Using cwhois with PHP!... 14 Using cwhois with PHP!... 14 DAS servers!... 15 Turing (CAPTCHA code)!... 15 Checking availability by NS server!... 16 Chapter 4 Support!... 17

Chapter 1 Introduction Chapter 1 Introduction What is cwhois cwhois is a PHP function that can be called from your own application to check availability of domain names and to retrieve the associated whois data. Also included is a special form handler that can be used to easily add cwhois to your website without knowing anything about PHP. Examples are provided showing how to add domain availability and lookup using various methods. For security cwhois includes an optional turing code (CAPTCHA) system to stop hackers from using your site to make multiple automated lookups. Easy to use php function call. More flexible than perl versions Simple to add to any page layout. No templates required Works with over 800 global and international domain extensions Determines whether domain is registered or not Returns full domain registration information No external whois utility required as cwhois includes this built in Supports some domain registrars such as.fm without dedicated whois server IDN support (accents) for com.net.de.ch.li.no.at.dk.be.se and others Makes use of DAS if available to check for availability Easy to include only the extensions that you require or wish to support Turing (CAPTCHA) code option stops abuse For a full list of supported domain extensions please visit the product home page at http://www.vibralogix.com/cwhois Page 4

Chapter 2 Using cwhois with a form Calling cwhois from a form Although cwhois was designed as a PHP function for use in your own application (this is described later) many users prefer to use it from a simple form on their site to check availability and/or perform lookups. We provide a simple form handler that sits between your form and cwhois to make this as easy as possible. Using this form handler you can create forms on your site that allow a user to enter a domain name for checking with the results being displayed either in a popup window or in the same page as your form. For security we also provide a CAPTCHA (turing) feature to help control access. cwhoisform.php is used to process your form and to call the cwhois function. You can call cwhoisform.php using either the GET or POST method and it expects the following fields domain domainext turing do This is the domain name to check. It can be with or without an extension. If no extension is included then this is expected to be in the field domainext. This is the optional domain extension if not included in domain. If enabled this is the turing code required for this action. This is an optional field to determine what results are displayed. The following values are valid. 1 - only availability is displayed. 2 - Availability is displayed and a link to lookup the whois data is provided if the domain is registered. When clicked the whois data is displayed in the same window. 3 - Availability is displayed and a link to lookup the whois data is provided if the domain is registered. When clicked the whois data is displayed in a popup window. 4 - Whois data is displayed for a registered domain. Page 5

Quick Tutorial You will find the tutorial files used in this section in the tutorial folder of the zip. To test them upload them to your server and make sure that you have the following files in the same folder. cwhois.php cwhoisform.php cwhoisform.css turingimagecw.php turingbg1.jpg turingbg2.jpg turingbg3.jpg turingbg4.jpg Before continuing open up cwhoisform.php and change the setting of $requireturing which you will find at the top of the file from $requireturing=1; to $requireturing=0; This will disable the turing code system for now (we will enable it again later). Lesson 1 Here is a very simple example form which we will expand upon over the next few pages in the style of a tutorial. This first stage will have a domain check form that will open a new browser window to display the results. As no do field is set then mode 3 is used by default when results are displayed in a new window or popup. Mode 3 means that already registered domains will have a lookup link displayed with the results shown in a popup. <form name="cwhoisform" id="cwhoisform" action="cwhoisform.php" method="post" target="_blank"> Domain <input type="text" name="domain"> <input type="submit" value="check"> </form> You can find this file called tutorial1.html in the tutorial folder of the zip file. Page 6

Lesson 2 One improvement on the above would be to have the results displayed in a smaller popup window instead of a full browser window. To do this we can use some simple javascript. Also we will add a drop down menu for the domain extension. <script type="text/javascript"> <!-- function cwhoispopup(myform, windowname) { if (! window.focus)return true window.open('', windowname, 'height=400,width=600,scrollbars=yes') myform.target=windowname return true } //--> </script> <form name="cwhoisform" id="cwhoisform" action="cwhoisform.php" method="post" onsubmit="return cwhoispopup(this, 'cwhois');"> Domain <input type="text" name="domain"> <select name="domainext"> <option value=".com">.com</option> <option value=".net">.net</option> <option value=".org">.org</option> </select> <input type="submit" value="check"> </form> You can find this file called tutorial2.html in the tutorial folder of the zip file. Lesson 3 Next we will add a CAPTCHA (turing) code requirement to the form. This stops hackers from using your server to make automated lookups. First of all open up cwhoisform.php and change the setting of $requireturing which you will find at the top of the file from $requireturing=0; to $requireturing=1; This will enable the CAPTCHA system again. To display a turing code you add an <img> tag to your form which will display the special image called turingimagecw.php. A form field called turingcode is added to get the user entered code along with a hidden field called turing. We also add a few lines of javascript to the forms onsubmit event function to ensure a new turing code is displayed when the form is Page 7

submitted (the current code is deleted when cwhois is called anyway so there is no security issue doing this in javascript). The javascript also clears the turingcode input field and copies the value to the turing field. <script type="text/javascript"> <!-- function cwhoispopup(myform, windowname) { tmp = new Date() tmp = "?"+tmp.gettime() window.document.images["turingimage"].src = "turingimagecw.php"+tmp myform.turing.value=myform.turingcode.value myform.turingcode.value="" if (! window.focus)return true window.open('', windowname, 'height=400,width=600,scrollbars=yes') myform.target=windowname return true } //--> </script> <form name="cwhoisform" id="cwhoisform" action="cwhoisform.php" method="post" onsubmit="return cwhoispopup(this, 'cwhois');"> Domain <input type="text" name="domain"> <select name="domainext"> <option value=".com">.com</option> <option value=".net">.net</option> <option value=".org">.org</option> </select> <br><br> Security Code <input type="hidden" name="turing" value=""> <input type="text" name="turingcode" id="turingcode" size="10"> <img id="turingimage" name="turingimage" src="turingimagecw.php" align="absmiddle"> <br><br> <input type="submit" value="check"> </form> You can find this file called tutorial3.html in the tutorial folder of the zip file. Page 8

Lesson 4 In the final step of this quick tutorial we will show how to have the results displayed within your page rather than in a popup.to do this we do not need to have the javascript to create the popup window or update the turing (it will update on page refresh anyway). At the point in your page where you want the results displayed insert this. <?php echo $cwhoisdata;?> At the very top of the page (before any html code) add this line. <?php include"cwhoisform.php";?> As this uses some PHP we will need to change the extension of the page containing the form to.php. So our page would look like this. <?php include"cwhoisform.php";?> <form name="cwhoisform" id="cwhoisform" action="tutorial4.php" method="post"> Domain <input type="text" name="domain"> <select name="domainext"> <option value=".com">.com</option> <option value=".net">.net</option> <option value=".org">.org</option> </select> <br><br> Security Code <input type="text" name="turing" id="turing" size="10"> <img id="turingimage" name="turingimage" src="turingimagecw.php" align="absmiddle"> <br><br> <input type="submit" value="check"> </form> <?php echo $cwhoisdata;?> You can find this file called tutorial4.php in the tutorial folder of the zip file. In the case of displaying the results in the same page if no do field is defined then the default value of 3 will be assumed. This will display a lookup link for any existing domain name which will open a popup window to display the results. To change this behavior just add the do field to the form with the required value. Page 9

Lesson 5 cwhoisform.php can accept input with multiple domain extensions so you can use checkboxes on the form. In this case the domain name with each of the extensions will be checked. Make sure to define the checkboxes with the name domainext[] so that several can be submitted like this. <input type="checkbox" name="domainext[]" value=".com">.com <input type="checkbox" name="domainext[]" value=".net">.net <input type="checkbox" name="domainext[]" value=".org">.org It is also possible to submit multiple domain names in the domain field separated by a newline character. This is ideal if you use a text area input and have the user enter each domain name on a separate line. For example <textarea name="domain" rows="6" cols="50"> </textarea> Example forms We have included a number of example pages you can use as is or incorporate in your own pages. Just make sure that cwhois.php and cwhoisform.php are in the same folder. We have included the CAPTCHA code (turing) in all of them but you can remove the code if required. Remember in cwhoisform.php that $requireturing must be set as follows: $requireturing=2; $requireturing=0; to enable the turing code system to disable the turing code system You can find this setting at the top of cwhoisform.php. Each of the examples also make use of a popup for the results but you can change this as required. See the earlier tutorial for further details. Page 10

freetext.html This example uses a text input where the full domain is entered. The results are displayed in a popup. dropmenu.html This example uses a separate drop down menu for the domain extensions. This is ideal if you want to restrict domain types that can be entered. checkbox.html This example as its name suggests uses checkboxes that allow the user to enter a domain name and select one or more extensions to check. Page 11

textarea.html This example allows a user to enter multiple domain names each on a separate line. For security reasons we limit the number of entries by default to 20 but you can change this in cwhoisform.php using the setting $maxdomains. textareacheckbox.html This example allows a user to enter multiple domain names (without extensions) each on a separate line and to select the required extensions using checkboxes.. For security reasons we limit the number of entries by default to 20 but you can change this in cwhoisform.php using the setting $maxdomains. Changing the appearance of the results The appearance of the results is determined by the styles in cwhoisform.css which you can change as required. This css file is loaded automatically when using a popup for the results. If you display the results in your own page then you should load this css file in the <head> section of your page as follows. Page 12

<link href="cwhoisform.css" rel="stylesheet" type="text/css"> You can change the text used within the results as you wish either to change the wording or perhaps to translate to other languages. You will find all of the text used at the top of cwhoisform.php. Each entry looks something like this. $cwlang['securitycode']="security code did not match"; Only change the text between the double quotes. You can if you wish use html within the text. For example here is how you can display a graphic to show if a domain is available or not:- $cwlang['available']="<img src='avail.gif' align='absmiddle'>"; $cwlang['notavailable']="<img src='notavail.gif' align='absmiddle'>"; notice that instead of using the " character in the html use a ' character. Security There are many hackers and other undesirables that search for whois lookup systems and then use them with an automated system to perform thousands of lookups and other data mining. This not only slows your server down but is likely to get your server IP banned from accessing the whois server. To control this we recommend using the turing code (CAPTCHA) system mentioned previously. This requires that a human readable code is entered before access is made to the whois server. cwhoisform.php allows multiple domain names or extensions to be entered in one call for the convenience of your clients. However to stop this being abused we limit the number of lookups performed each time to 20. You can change this limit in the $maxdomains setting found at the top of cwhoisform.php. Page 13

Chapter 3 - Using cwhois with PHP Chapter 3 Using cwhois with PHP Using cwhois with PHP Although for most applications you can probably use the form handler cwhoisform.php to control access to cwhois there maybe instances where you require more control. In this case it is best to call the cwhois PHP function directly as follows. $result=cwhois($domain,$domainext,$data,$turing,$turingused); $domain String containing the domain name $domainext String containing the domain extension (e.g..com) $data An array passed by reference that returns the whois data. $turing Optional string parameter. If the turing system is enabled then pass in the turing code in this string. $turingused Optional integer parameter. If set to 0 will not reset the turing enabling you to make further calls with the same code. If set to 1 (default) then the code is flagged as used. $result This is an integer value flagging if the domain is available etc. The following values are valid. 0 - Domain is not registered 1 -The domain is registered. $data should populate now with an array, each element being a line from the whois output. 2 - Domain extension is not recognised by cwhois 3 - Domain name is not valid 4 - Turing code check failed (if enabled) 5 - Error connecting with whois server Here is a simple call not using the turing code system. include "cwhois.php"; $domain="vibralogix"; $domainext=".com"; $result=cwhois($domain,$domainext,$data); if ($result==0) echo "domain is available"; if ($result==2) echo "domain extension not supported"; if ($result==3) echo "domain name not valid"; if ($result==5) echo "unable to connect to whois server"; if ($result==1) { for ($k=0; $k<count($a);$k++) echo $a[$k]."<br>\n"; } Page 14

Chapter 3 - Using cwhois with PHP DAS servers Because of widespread abuse of whois servers some registrars now have separate server for availability checking and full whois checking. These are called DAS for short (Domain Availability Server) and often allow greater use before blocking than the full whois server. cwhois uses these DAS servers wherever possible if only an availability check is required. Therefore if you are just checking availability and do not need to get the returned whois data we recommend telling cwhois this so that it will use DAS if it can. To do this pass in a * character in the $data parameter when making the call. For example. $domain="vibralogix"; $domainext=".com"; $data="*"; $result=cwhois($domain,$domainext,$data); Turing (CAPTCHA code) To control abuse of your scripts using cwhois we have built in a turing (CAPTCHA) code system. To use this system first make sure that the include line for cwhois.php is at the very top of your page before the <html> and any other characters in the page. Also before this include add the setting $requireturing as follows:- <?php $requireturing=2; include"cwhois.php";?> The setting of $requireturing has three allowed values. 0 This disables the turing code system 1 This requires a valid turing code for both availability checking and full lookup. 2 This requires a valid turing code for a full lookup only. To display the turing code in your page use the following html. <img src="turingimagecw.php" width="60" height="30"> Page 15

Chapter 3 - Using cwhois with PHP Just get the user to input what they see and send this to the cwhois function with the call. The cwhois function will then flag the code as used so that it cannot be used again. $requireturing=1; include "cwhois.php"; $domain=$_request['domain']; $domainext=$_request['domainext']; $turing=$_request['turing']; $result=cwhois($domain,$domainext,$data,$turing); if ($result==0) echo "domain is available"; if ($result==2) echo "domain extension not supported"; if ($result==3) echo "domain name not valid"; if ($result==4) echo "security code was not valid"; if ($result==5) echo "unable to connect to whois server"; if ($result==1) { for ($k=0; $k<count($a);$k++) echo $a[$k]."<br>\n"; } There maybe be circumstances where you will need to make multiple calls to the cwhois function with only one turing code entered by the user. In this case you can set the optional parameter $turingused to 0 as follows. $result=cwhois($domain,$domainext,$data,$turing,0); On the final call that uses the same turing code make sure to set $turingused to be 1 so that the code gets flagged as used. Checking availability by NS server We have tried to add support for all the domain extensions that have whois servers available. However you can also check availability for non supported domain extensions by checking for a name server. This is not as reliable but it may be sufficient form some applications. To add this support for specific domain extensions add the lines to cwhois (near the other entries) like this $dtd[]=".ext,ns,not found"; Replace the.ext with the extension required. Page 16

Chapter 4 - Support Chapter 4 Support Hopefully if you have followed this manual carefully everything will be working fine. However sometimes things don t go quite so smoothly so if you have any questions or problems then please check the FAQ on the support page or email us. Support and updates for cwhois are free of charge for one year after purchase. Shortly after purchase you should receive a username and password that provide you with access to the latest downloads, FAQ and other resources. Support area: http://www.vibralogix.com/support Email: support@vibralogix.com Page 17