Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP Whois Function

Posted on 2008-10-20
3
Medium Priority
?
495 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 1500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
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…

721 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