Finally fixed it!
This worked for both my iPad3 and iPhone 4s:
1- went to the phone's wifi setting and turn it off
2- pressed the power and home button until the apple logo showed up.
3- once it booted up, went to the wifi setting and selected my wifi network.
4-manually typed in the ip, subnet mask, and dns (because the DHCP was not loading)
I hope this helps!
Thanks to AJCL that has suggested the first 3 steps
What this really means is that the DHCP service in your router is not working properly. This could be due to the DHCP daemon being stopped or hung, a router bug, or that the router is too busy to return a DHCP response within the timeout period after a request from a client.
If you use Static IPs make sure that the IP that you use is not within the IP address pool that your router is using for DHCP and check the "Static" choice for "IP Address" selection when you enter your IP, subnet mask, DNS, etc. into the Network details.