Page 1 of 1

search multiple domains at once?

Posted: Fri Feb 24, 2006 11:24 am
by MinDFreeZ
Not sure if this is a simple are advanced question... but basically im sick of typing a domain and searching for its availability and if its not, i have to go back and type in another one..... i cant find a site where i can search multiples, so i was looking for a script...

http://www.hotscripts.com/Detailed/3080.html was one that searches for multiple extensions... but i just want like 5 inputs i can just search at once for domains (all .com's) ... anyone know of such a thing or a script somewhere?

I can find whois scripts all over.. but that doesnt help.. i need multiples on one page...

Posted: Fri Feb 24, 2006 11:44 am
by John Cartwright
Why not just loop over the multiple inputs?

For example,

Code: Select all

$whois = new whois(); //whois class object

if (is_array($_POST['domains']) & count($_POST['domains']) > 0) {
   foreach ($_POST['domains'] as $domain) {
      $available = $whois->checkDomain($domain);
      echo $domain .' is ' ($available ? 'available' : 'not available') .'. <br />';
   }
}
Or you can always configure your whois class to take array inputs

Posted: Fri Feb 24, 2006 3:54 pm
by MinDFreeZ
getting
Parse error: parse error, unexpected '(', expecting ',' or ';' in....

on this line

Code: Select all

echo $domain .' is ' ($available ? 'available' : 'not available') .'. <br />';
but i dont really even understand what this is doing...

plus I have no clue how to set up the form for this.... or even use a class for that matter, but i thought id be able to figure that part out.... if i can figure out how to set up the form.....


edit: changed it to this and the script has no errors.... but i still dont know how to use it :P

Code: Select all

echo $domain . " is " . ($available ? 'available' : 'not available') . ' . <br />';

http://www.sloppycode.net/Sloppycode/Article-69.html is what I just found.... so let me look through that and figure it out...

Posted: Fri Feb 24, 2006 4:25 pm
by MinDFreeZ
edit: got it all figured out, thank you very much sir!