If your phone can connect properly to other WiFi networks that might indicate an issue with your router. If your phone is having this same kind of range connectivity issue with any WiFi network you connect with, that could be a problem with the antenna inside your phone.
So have you tried connecting to other WiFi networks (at a friend's, or at work, or at some public WiFi)? If this is just a home matter, what kind of router do you have?