How can I get a PHP script to generate a list of 3 letters and then have it query like:

site.com/query.php?query=$query

and return the results?

I'm doing this to look for domain names