search multiple domains at once?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MinDFreeZ
Forum Commoner
Posts: 58
Joined: Tue Feb 14, 2006 12:28 pm
Location: Lake Mary, FL

search multiple domains at once?

Post 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...
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
MinDFreeZ
Forum Commoner
Posts: 58
Joined: Tue Feb 14, 2006 12:28 pm
Location: Lake Mary, FL

Post 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...
MinDFreeZ
Forum Commoner
Posts: 58
Joined: Tue Feb 14, 2006 12:28 pm
Location: Lake Mary, FL

Post by MinDFreeZ »

edit: got it all figured out, thank you very much sir!
Post Reply