Solved

PHP Whois Function

Posted on 2008-10-20
3
491 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Expert Comment

by:Umesh
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 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