Solved

PHP Whois Function

Posted on 2008-10-20
3
464 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
Comment Utility
0
 

Author Comment

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

Accepted Solution

by:
MatthiasVance earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now