PDA

View Full Version : Create a Whois Search



bigfiles
April 29th, 2007, 04:33
A Whois search is a search bar that you use for checking for info about domains, like if they are availible or if when they expire.

To add this to your site, it takes two very simple steps...

STEP ONE

Add this code to the very top of the page...make sure the web page is saved as .php



<? if($site != "") { exec("whois $site", $output, $error); while (list(,$line) = each($output)){ echo $line, "
n"; } } ?>


STEP TWO

Now place this code wherever you want the actual search form to appear...



<form action="" method="POST">
<input type="text" name="site" value=".COM .NET .ORG">
<input type="submit">
</form>


Enjoy!

midwesthosting
April 29th, 2007, 04:44
Kinda cool,May use this,If i can get it coded correctly,Nicely seperated

themoose
April 29th, 2007, 08:33
Nice, but can I add one small part of security to your script:

<? if($site != "") { exec("whois ".escapeshellarg($site), $output, $error); while (list(,$line) = each($output)){ echo $line, "
n"; } } ?>

TSO
April 29th, 2007, 14:21
How does it work, though? Is whois a built-in function or something?

krakjoe
April 29th, 2007, 15:35
is on linux, on windows the command doesn't exist and so http://krakjoe.com/projects/Winis

TSO
April 29th, 2007, 17:11
Ah, ok. Thanks for posting it then! I'll have to add it to one of my sites. :)

ezhost-anish
April 29th, 2007, 17:35
this does a pretty hand work easily!!

Dan
April 30th, 2007, 02:22
Nice job. Will come in handy

kimchris
April 30th, 2007, 03:46
your example works with Linux only and it require you to have permission to use the whois program attached to Linux distribution. if you tried to google search for any whois script you're going to find tons of script and all works in Windows + Linux + it will work on your own computer if you have ( Appserv , IIS ) installed. anyway thanks for share...

iBrightDev
April 30th, 2007, 09:17
your example works with Linux only and it require you to have permission to use the whois program attached to Linux distribution. if you tried to google search for any whois script you're going to find tons of script and all works in Windows + Linux + it will work on your own computer if you have ( Appserv , IIS ) installed. anyway thanks for share...

Colin's or bigfiles?

krakjoe
April 30th, 2007, 11:36
both, unless you install a whois utility for windows and place it in your PATH then that code will output "command not found" when you try to execute it on windows, most versions of linux come with a whois command built in

themoose
April 30th, 2007, 11:40
Colin's or bigfiles?

both.. mine is bigfiles slightly modified.

iBrightDev
April 30th, 2007, 14:21
both.. mine is bigfiles slightly modified.

ok, thanks.