# Checking Domain Availability with PHP

**URL:** <https://forum.kirupa.com/t/checking-domain-availability-with-php/207431>\
**Category:** programming\
**Created:** [November 17, 2006, 2:07pm UTC](https://forum.kirupa.com/t/checking-domain-availability-with-php/207431 "2006-11-17T14:07:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Stranger](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@The\_Stranger](https://forum.kirupa.com/u/The_Stranger)\
**Post date:** [November 17, 2006, 2:07pm UTC](https://forum.kirupa.com/t/checking-domain-availability-with-php/207431/1 "2006-11-17T14:07:21Z")

</div>

Hi guys! I’m having some trouble making a script to check a domain’s availability… Here’s what I got:

```php

$fp = fsockopen("whois.opensrs.net",43);
fputs($fp,$domain_name);
while(!feof($fp)) {
echo fgets($fp,1048);
echo "<br />";
} //while
fclose($fp);

```

That just tell me the “whois” info, and that’s fine but I want to refine the results to: “It’s availabe” and “Sorry, it’s taken”. Any Ideas will be appreciated!
