Solved

PHP Whois Function

Posted on 2008-10-20
3
468 Views
Last Modified: 2013-12-13
Folks,

Am developing a web hosting project, i just wanna confirm how domain name whois information is written in PHP.
0
Comment
Question by:nitation
3 Comments
 
LVL 26

Expert Comment

by:ushastry
ID: 22755846
0
 

Author Comment

by:nitation
ID: 22756120
None of the both is working. One error to the other.
0
 
LVL 8

Accepted Solution

by:
MatthiasVance earned 500 total points
ID: 22758867
I hope this helps you.

Kind regards,

Matthias Vance
<?php
	error_reporting(E_ALL);
 
	function whois($query, $server) {
		$socket = fsockopen($server, 43, $errno, $errstr, 10);
		if(!$socket) {
			return false;
		}
		fwrite($socket, $query . "\r\n");
		$response = "";
		while(!feof($socket)) {
			$response .= fgets($socket, 1024);
		}
		fclose($socket);
		return $response;
	}
 
	echo whois("matthiasvance.com", "whois.verisign-grs.com");
?>

Open in new window

0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question