The PET located here is unneccesarily complicated.

http://www.linuxjunior.org/cgi-bin/p...lay&id=104

Perhaps everything listed there was required at one point, but these days things have been greatly simplified.

Starting from the point where you have your drivers installed and it'sm detecting your card as a valid, active interface, simply type

Code:
sudo iwlist <interface> scan
For me, I type "sudo iwlist ath0 scan". This presents me with a list of networks that my card is seeing. Take a look at this list, and find the network you want to connect to. The network name should appear next to the "ESSID" label. Then, type

Code:
sudo iwconfig <interface> essid <networkname> key <networkkey>
If you don't have a network key (ie, encryption is off), use 'off' for <networkkey>. For example, to connect to my school's wireless network, I simply type " sudo iwconfig ath0 essid "uw-wireless" key off ". And that's that.

There's also a script located at http://ubuntuforums.org/archive/index.php/t-25398.html . It's written in PHP and does essentially what I just said, but automatically.