NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP 3/2-letter/Number snippet

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
3 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-12-2005, 04:38 PM THREAD STARTER               #1 (permalink)
Senior Member

Join Date: Apr 2005
Location: .ma.us
Posts: 1,883
DropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud of
 


Baby Health Save a Life Save The Children

PHP 3/2-letter/Number snippet


I have these snippets, think I got them off this site, and they list letter combos etc. I want to make it so I can add a tld to the end of all the combos but when i try the tld is in front and not at the end here are the snippets:

2 # combos
Code:
<?
/*
1 - 999
*/
$ini = 0;
$fin = 99;
for($i=$ini; $i<=$fin; $i++)
{
printf( "%s<br />\r\n", str_pad($i, 2, "0", STR_PAD_LEFT) );
}
?>
3 letter combos
Code:
<?

$letra = array();
for($i=97; $i<=122; $i++)
{
$letra[] = chr($i);
}

foreach($letra AS $a) {
foreach($letra AS $b) {
foreach($letra AS $c) {
echo "$a$b$c<br />\r\n";

}
}
}
?>
3 # combos
Code:
<?
/*
1 - 999
*/
$ini = 0;
$fin = 999;
for($i=$ini; $i<=$fin; $i++)
{
printf( "%s<br />\r\n", str_pad($i, 3, "0", STR_PAD_LEFT) );
}
?>
anyone know how to pop in a schalar that would be at the end of all the combos?
__________________
GEO & Travel Domains For Sale - MUST SEE!
Chinaphobia.com - WorldRails.com - RussianReserves.com
DropLister is offline  
Old 06-13-2005, 07:41 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



By the "end" I'm guessing you mean on the right side such as:

00TLD-HERE

?
deadserious is offline  
Old 06-14-2005, 03:51 AM THREAD STARTER               #3 (permalink)
Senior Member

Join Date: Apr 2005
Location: .ma.us
Posts: 1,883
DropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud of
 


Baby Health Save a Life Save The Children
right
__________________
GEO & Travel Domains For Sale - MUST SEE!
Chinaphobia.com - WorldRails.com - RussianReserves.com
DropLister is offline  
Old 06-14-2005, 03:43 PM   #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Wouldn't this work?

Code:
printf( "%sTLDHERE<br />\r\n", str_pad($i, 3, "0", STR_PAD_LEFT) );
deadserious is offline  
Old 06-14-2005, 08:08 PM   #5 (permalink)
Account Suspended
 
axilant's Avatar
Join Date: May 2004
Location: /etc/passwd
Posts: 2,178
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
 

Member of the Month
July 2005

got bored...

PHP Code:
<?
$ext 
"org";
$letra = array();
for(
$i=97$i<=122$i++)
{
$letra[] = chr($i);
}

foreach(
$letra AS $a) {
foreach(
$letra AS $b) {
foreach(
$letra AS $c) {
$str[] = "$a$b$c";

}
}
}
function 
docheck($name$ext)
{
    
$whois=array();
    
$whois[de] = "No entries found for the selected source";
    
$whois[fr] = "No entries found for the selected source";
    
$whois[co.uk] = "No match for";
    
$whois[com] = "No match for";
    
$whois[net] = "No match for";
    
$whois[org] = "Not found";
    
$whois[ch] = "We do not have an entry in our database matching your query";
             
    
$domain "$name.$ext";
    
ob_start();
    
system("whois {$domain}");
    
$whoisdata ob_get_contents();
????: NamePros.com http://www.namepros.com/programming/98084-php-3-2-letter-number-snippet.html
    
ob_end_clean();
????: NamePros.com http://www.namepros.com/showthread.php?t=98084
    
$text $whois[$ext];
    if(
eregi($text$whoisdata) == true)
    {
        return 
true;
     }
     else
    {
        return 
false;
    }
}
foreach(
$str AS $name)
{
    
flush();
    
sleep(2);
    if(
docheck($name,$ext)==true)
    {
        print(
"$name.$ext - Available<BR>");
    }
    else
    {
        print(
"$name.$ext - Unavailable<BR>");
    }
}
?>
I dont suggest removing flush() and sleep(2)

This will check if its available or not...

Have fun...

please donate np$ if you use it
http://phpprint.com/whois.php for example of the code above... if you need help just ask
axilant is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
Beware of PHP! PolurNET The Break Room 25 03-29-2005 03:04 PM

 
All times are GMT -7. The time now is 12:32 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger